fts {fts} | R Documentation |
create an fts object by specifying dates and data
fts(data, dates) ## S3 method for class 'fts' dates(x) ## S3 replacement method for class 'fts' dates(x) <- value
data |
a matrix, dataframe, or vector |
dates |
a vector of dates (default format is POSIXct) |
x |
an fts object |
value |
a vector of POSIXct dates |
... |
further arguments to function |
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
a fts object
Whit Armstrong
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 cxy <- cbind(x,y) rxy <- rbind(x,y) print(x) plot(x)