View source: R/count_bizdays.R
| count_bizdays | R Documentation |
Count the number of business days between a range of dates, inclusively.
count_bizdays(from, to, holidays, weekend = c("Sat", "Sun"))
from |
The beginning of the date range. |
to |
The end of the date range. |
holidays |
A vector of dates that are holidays. |
weekend |
A character vector of three-letter abbreviations of weekday names indicating days
that should be considered a weekend. Acceptable values are: |
Holiday dates can be obtained using get_holidays(), get_province(), or by defining a custom
vector of holidays.
A single number.
is_bizday(), is_holiday(), is_weekend()
library(lubridate)
winter_holidays <- ymd(c("2025-12-25", "2025-12-26"))
count_bizdays(from = ymd("2025-12-20"), to = ymd("2025-12-31"), holidays = winter_holidays)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.