count_bizdays: Count the number of business days between a range

View source: R/count_bizdays.R

count_bizdaysR Documentation

Count the number of business days between a range

Description

Count the number of business days between a range of dates, inclusively.

Usage

count_bizdays(from, to, holidays, weekend = c("Sat", "Sun"))

Arguments

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: "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun".

Details

Holiday dates can be obtained using get_holidays(), get_province(), or by defining a custom vector of holidays.

Value

A single number.

See Also

is_bizday(), is_holiday(), is_weekend()

Examples

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)

holideh documentation built on April 9, 2026, 5:09 p.m.