Constructor Function for timeRelative Class

DESCRIPTION:

Construct a timeRelative object.

USAGE:

timeRelative()
timeRelative(x, holidays., by, k.by=1, align.by=F, week.day=NULL)

OPTIONAL ARGUMENTS:

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 by, k.by, align.by, and week.day if desired to construct a timeRelative object. by is one of the following character strings, giving the time units for the relative time: "milliseconds" or "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", or "years" or "yr". To add or subtract specific days of the week, use "sun", "mon", "tue", "wed", "thu", "fri", or "sat". See for more information on these arguments.
k.by
the number of by time units in the relative time, a non-zero integer.
align.by
whether or not to use alignment (see documentation on the relative time class).
week.day
if not NULL, and by is "weeks", you can supply a character string (or an integer, 0 to 6 with 0 being Sunday) to specify a weekday to use for the relative time. The character string must be sufficient to make a unique case-insensitive match to the strings in options("time.day.name").

VALUE:

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.

SEE ALSO:

EXAMPLES:

# 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)