fts (version 0.7.5)

fts: Fts: a fast timeseries library

Description

create an fts object by specifying dates and data

Usage

fts(data, dates)

## S3 method for class 'fts': head(x, n = 10,\dots) ## S3 method for class 'fts': tail(x, n = 10,\dots) ## S3 method for class 'fts': dates(x) ## S3 method for class 'fts': dates(x) <- value

Arguments

data
a matrix, dataframe, or vector
dates
a vector of dates (default format is POSIXct)
x
an fts object
n
an integer specifying the number of rows
value
a vector of POSIXct dates
...
further arguments to function

Value

  • a fts object

Details

fts is an S3 class in which the fts object is represented as a native R matrix and the dates are attached as an attribute to the matrix

See Also

as.fts

Examples

Run this code
x <- fts()
y <- fts(data=1:100)
z <- fts(dates=seq.POSIXt(from=as.POSIXct(Sys.time()),by="months",length.out=12))

xx <- x[1:10,]

## intersection of dates is taken for Arith methods
xyp <- x + y
xys <- x - y
xym <- x * y
xyd <- x / y
xyg <- x > y
xyl <- x < y

head(x,5)
tail(y,10)
cxy <- cbind(x,y)
rxy <- rbind(x,y)
print(x)
plot(x)

Run the code above in your browser using DataCamp Workspace