| gendtstr | R Documentation |
COnverts a generic relative string defining one or two endpoints to exact dates or datestrings
gendtstr(x, today = Sys.Date(), rtn = "dtstr")
narrowbydtstr(
xin,
dtstr = "",
includetoday = TRUE,
windowdays = 0,
invert = FALSE,
addindicator = FALSE
)
extenddtstr(
instr,
begchg = 0,
endchg = 0,
mindt = NULL,
maxdt = NULL,
rtn = "",
rtnstyle = "string"
)
x |
String describing generalized date as of today |
today |
Default |
rtn |
string describing what to do: ( |
xin |
Input |
dtstr |
Generalized Date string of the form |
includetoday |
(Default: TRUE) pass either today |
windowdays |
(Default: 0)Number of additional days to add at beginning of series |
invert |
(Default: FALSE) Return dates not in |
addindicator |
(Default: FALSE) Returns original dataset with logical variable |
instr |
Input generalized date string, |
begchg |
(Default: 0) Number of calendar days to extend beginning |
endchg |
(Default: 0) Number of calendar days to extend end |
mindt |
Minimum date to return |
maxdt |
Maximum date to return |
rtnstyle |
REturn datestring or list |
an exact start date startdt and an exact end date enddt, in the following forms:
If rtn="list" returns c(startdt,enddt), if rtn="first" then startdt, if rtn="days then an integer number of days from startdt to today otherwise (by default) "startdt::enddt"
Same form as xin, i.e. a data.table or data.frame
character string or list with new dates
gendtstr("-3m::")
gendtstr("-2y::-3m",today=as.Date("2025-03-15"))
narrowbydtstr(eqtypx,"-2m::-1m")
extenddtstr("-2m::-1m")
extenddtstr("-2m::-1m",begchg=-10,endchg=5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.