Description Usage Arguments Value Author(s) Examples
offset the datelist by months,quarters,ect. then get the nearest tradingday
1 2 | trday.offset(datelist, by = months(1), stockID = NULL, dir = if
(as.numeric(by) > 0) 1L else -1L, TS, drop)
|
datelist |
a vector of class Date |
by |
a period object. See detail in package |
stockID |
a character string or null. If null, the market trading days, other wise the trading days of specific stock. |
dir |
1L or -1L. if the result date is not trdingday, get the forward nearest tradingday or the backward tradingday? See detail in trday.nearest |
a vector of trading days of class Date
Ruifei.Yin
1 2 3 4 5 | (datelist <- as.Date(c("2012-07-21","2012-07-22","2012-07-23","2013-01-30")))
trday.offset(datelist,months(1)) # the tradingdays 1 month after the datelist
trday.offset(datelist,months(-1)) # the tradingdays 1 month before the datelist
trday.offset(datelist,years(1))
trday.offset(datelist,months(-1),stockID="EQ000527")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.