timeseries: extra zoo creator

Description Usage Arguments Examples

View source: R/augment.R

Description

using three of the four from, to, by, length.out parameters, creates a data.frame that satisfies the requirements for a time series set. any extra data is considered a measurement column and added in the standard R fashion.

the returned data.frame has at least the column timestamps. the first timestamp is equal to from, the last is equal or less than to, the distance between two subsequent timestamps is by, there are length.out elements (length.out - 1 steps of distance by).

data may be specified as numeric, in which case it is considered indicating minutes, or as POSIXct objects.

Usage

1
timeseries(from, to, by, length.out, order.by, ...)

Arguments

from

the starting instant of the resulting time series. either POSIXct or double.

to

the ending instant of the resulting time series. either POSIXct or double.

by

the timestep in the timeseries. either a difftime or a numeric

length.out

if specified, ensures the resulting timeseries contains length.out elements (length.out - 1 steps).

order.by

if specified, the resulting timeseries uses these timestamps as index instead of building its own from the above described four parameters.

...

any other named field is added as field in the resulting timeseries. the lenght must match the length.out parameter.

Examples

1
2
firstminutes <- timeseries(0, 1000, by=50, constant=355/113)
uptomidnight <- timeseries(to=Sys.Date(), by=90, length.out=5, countdown=4:0)

delftfews documentation built on May 2, 2019, 4:48 p.m.