cal_us_federal {almanac}R Documentation

US federal calendar


cal_us_federal() is an example calendar that represents the federal holidays in the United States. It makes no attempt to be historically accurate, but instead represents the currently recognized federal holidays. The calendar represents the observed dates of each holiday, rather than the actual dates of each holiday (i.e. if a holiday falls on a Saturday, it is federally observed on the preceding Friday).

Refer to the source code of cal_us_federal() to get a feel for how to build your own personal calendar.


cal_us_federal(since = NULL, until = NULL)




A lower bound on the event set to generate.

Defaults to almanac_since() if not set.



An upper bound on the event set to generate.

Defaults to almanac_until() if not set.


An rcalendar.


cal <- cal_us_federal()

# All 2023 holidays
cal_events(cal, year = 2023)

# Notice that for 2028, `cal_events()` knows that you probably want to
# treat New Year's Day as a 2028 holiday even though it will observed in
# 2027 (because it will be a Saturday and will be rolled back to being
# observed on Friday)
cal_events(cal, year = 2028)

# Were any of these dates on a holiday?
x <- as.Date(c(

alma_in(x, cal)

# Which one?
cal_match(x, cal)

[Package almanac version 1.0.0 Index]