timeRelative | R Documentation |
Construct a timeRelative
object.
timeRelative(x, holidays., by, k.by=1, align.by=FALSE, week.day=NULL)
x |
a character string vector representing relative times. |
holidays. |
a time/date or time sequence object giving holiday dates. |
by |
as an alternate to providing a character string vector,
you can provide
"milliseconds" "ms" "seconds" or "sec" "minutes" or "min" "hours" or "hr" "days" or "day" "weekdays" or "wkd" "bizdays" or "biz" "weeks" or "wk" "tdy" (for 10-day periods in a month) "months" or "mth" "quarters" or "qtr" "years" or "yr" To add or subtract specific days of the week, use "sun" "mon" "tue" "wed" "thu" "fri" "sat" See |
k.by |
a non-zero integer specifying the number of |
align.by |
a logical value. If |
week.day |
if not |
returns a timeRelative
object with the given strings
as data, and holidays, if given.
Otherwise, the strings default to empty, and the holidays to no holidays.
timeRelative
# Create a relative time object that you could add to a time/date object
# to take each element to the third Friday of the month
rtobj <- timeRelative("-a0mth -1fri +3fri")
timeDate(c("1/5/1998", "2/26/1998"), format = "%a %m/%d/%Y") + rtobj
# Create a relative time object for 3 minutes
timeRelative(by="minutes", k.by=3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.