Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

irts

Irregularly Spaced Time-Series


Description

The function irts is used to create irregular time-series objects.

as.irts coerces an object to an irregularly spaced time-series. is.irts tests whether an object is an irregularly spaced time series.

Usage

irts(time, value)
as.irts(object)
is.irts(object)

Arguments

time

a numeric vector or a vector of class "POSIXct" representing the time-stamps of the irregular time-series object. The elements of the numeric vector are construed as the (signed) number of seconds since the beginning of 1970, see POSIXct.

value

a numeric vector or matrix representing the values of the irregular time-series object.

object

an R object to be coerced to an irregular time-series object or an R object to be tested whether it is an irregular time-series object.

Details

The function irts is used to create irregular time-series objects. These are scalar or vector valued time series indexed by a time-stamp of class "POSIXct". Unlike objects of class "ts", they can be used to represent irregularly spaced time-series.

Value

A list of class "irts" with the following elements:

time

a vector of class "POSIXct".

value

a numeric vector or matrix.

Author(s)

A. Trapletti

See Also

Examples

n <- 10
t <- cumsum(rexp(n, rate = 0.1))
v <- rnorm(n)
x <- irts(t, v)
x

as.irts(cbind(t, v))

is.irts(x)

# Multivariate
u <- rnorm(n)
irts(t, cbind(u, v))

tseries

Time Series Analysis and Computational Finance

v0.10-48
GPL-2
Authors
Adrian Trapletti [aut], Kurt Hornik [aut, cre], Blake LeBaron [ctb] (BDS test code)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.