Learn R Programming

splusTimeSeries (version 1.5.0-73)

timeSeries: Create a timeSeries Object

Description

Creates an object of time class timeSeries.

Usage

timeSeries(data, positions., units., from = timeCalendar(d = 1,
    m = 1, y = 1960), by = "days", k.by = 1, align.by = FALSE,
    week.align = NULL)

Arguments

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, b
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 cha
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.
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 st

See Also

timeSeries class, timeSequence.

Examples

Run this code
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")

Run the code above in your browser using DataLab