find_bd: Find Business Days

Description Usage Arguments Value Examples

View source: R/data-clean.R

Description

Finds the first or last business days in a month and returns the respective date vector.

Usage

1
find_bd(dates, type = "first")

Arguments

dates

a date vector.

type

a character vector. type="first" (default) delivers the first business day in a month and type="last" the last business day in a month.

Value

a date vector with the respective first or last business days for each month in dates.

Examples

1
2
3
4
data(sp500)
dates <- as.Date(sp500[,1], format="%d.%m.%Y", stringsAsFactors=FALSE)
firstdays <- find_bd(dates)
lastdays <- find_bd(dates, type="last")

antshi/auxPort documentation built on Oct. 27, 2020, 1:16 p.m.