This procedure explains how to create a new column in Exploratory that determines whether a date in your data is a US holiday (either a weekend or a public holiday), using the isHoliday function from the RQuantLib package.
To use the isHoliday function in Exploratory, you must first install the RQuantLib package.
From the Project menu, select “Manage R Packages”.
When the “Manage R Packages” dialog appears, click the “Install New Packages” tab.
In the “Enter package name to install” field, type “RQuantLib”, and then click the “Install” button to begin installing the package.
Once the message “RQuantLib is successfully installed” appears, the installation is complete.
After the RQuantLib package is installed, you can create a calculated column to identify holidays.
In the table view, from the header menu of the date-type column (e.g., the “Date” column), select “Create Calculation” then “Standard”.
When the “Create Calculation” dialog appears, specify the following calculation expression:
isHoliday("UnitedStates", Date)
Enter “Holiday” as the name for the new column and run it.
A
new “Holiday” column will be added to the table view, showing TRUE/FALSE
values indicating whether each date is a US holiday (weekend or public
holiday).