timeSeries(data, positions., units., from = timeCalendar(d = 1, m = 1, y = 1960), by = "days", k.by = 1, align.by = FALSE, week.align = NULL)
data | (ANY) the variable data. Can be any data object for which is.rectangular is TRUE, such as a data.frame, matrix, or atomic vector. |
positions. | (positions) the x values for the variables. Must be of type positionsCalendar. If not given, then the positions are computed using the timeSeq function with the from, by, k.by, align, and week.align arguments. |
units. | (character) the units for the data. |
from | the starting value of the sequence. A timeDate object (or number or character string representing one). |
by |
the spacing between successive values in the sequence. Can be
a timeSpan, timeRelative, or numeric value,
in which case k.by is ignored.
Alternatively, it can be one of the following character strings:
|
k.by | a non-zero integer giving the width of the interval between consecutive values in the sequence in terms of the units given in by. Ignored if by is not a character string. |
align.by | a logical value. If TRUE, adjusts the sequence so that each element is on a whole number of the by * k.by units. For example, if the units are 2 months, the sequence is only on the first of January, March, and so on. Ignored if by is not a character string. |
week.align |
if by is "weeks", you can supply a character
string (or a number, 0 to 6, with 0 being Sunday)
to specify a weekday to use. (The character string must
be sufficient to make a unique case-insensitive match to the
strings in timeDateOptions("time.day.name").)
|
timeSeries( pos=timeCalendar( d=1:10 ), data = 1:10) timeSeries(data=data.frame(x=1:10, y=11:20), from="7/4/2000", by="bizdays")