is.holiday
From chron v2.2-33
by Kurt Hornik
Find Weekends and Holidays in a Chron or Dates Object
Determine the date represented by a chron or dates object is a weekend or a holiday.
- Keywords
- chron
Usage
is.weekend(x)
is.holiday(x, holidays)
.Holidays
Arguments
- x
- an object inheriting from
"dates"
, or coercible to"chron"
. - holidays
- optional
"chron"
or"dates"
object listing holidays. If argumentholidays
is missing, either the value of the object.Holidays
(if it exists) orNULL
will be used.
Value
- a logical object indicating whether the corresponding date is a
weekend in the case of
is.weekend()
or a holiday in the case ofis.holiday()
.
See Also
days
,
weekdays.default
,
months.default
,
quarters.default
,
years
;
chron
,
dates
,
cut.dates
,
seq.dates
Examples
dts <- dates("01/01/98") + trunc(365 * runif(50))
table(is.weekend(dts))
.Holidays
# New Year Memorial Indepen. Labor day Thanksgiving Christmas
# 01/01/92 05/25/92 07/04/92 09/07/92 11/26/92 12/25/92
# NOTE: Only these 6 holidays from 1992 are defined by default!
Community examples
Looks like there are no examples yet.