as.caldays | R Documentation |
Convert Stata business calendar dates in readable dates.
as.caldays(buisdays, cal, format = "%Y-%m-%d")
buisdays |
numeric Vector of business dates |
cal |
data.frame Conversion table for business calendar dates |
format |
character String with date format as in |
Returns a vector of readable dates.
Jan Marvin Garbuszus jan.garbuszus@ruhr-uni-bochum.de
Sebastian Jeworutzki sebastian.jeworutzki@ruhr-uni-bochum.de
# read business calendar and data sp500 <- stbcal(system.file("extdata/sp500.stbcal", package="readstata13")) dat <- read.dta13(system.file("extdata/statacar.dta", package="readstata13")) # convert dates and check dat$ldatescal2 <- as.caldays(dat$ldate, sp500) all(dat$ldatescal2==dat$ldatescal)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.