I’m trying to use chron‘s is.holiday() function, but I’m having trouble getting it to work. The documentation says to modify the .Holiday object with the holidays that you wish to use, but the changes I’ve made to .Holiday don’t seem to be detected by is.holiday(). Could someone provide an example of the appropriate way to load holidays?
I’m trying to use chron ‘s is.holiday() function, but I’m having trouble getting it
Share
This is non-trivial and probably deserves to be referred to the
chronmaintainer as a bug.(Someone who actually works with dates in R more often than I do probably has a more elegant solution for the preceding stuff, without that double-
sapplything …)But this doesn’t change the important thing, which is the version of
Holidaysin thechronnamespace:The clue is here: Override a function that is imported in a namespace
Namespace magic:
Now look, and it has worked:
Test it out: