fts: Fts: a fast timeseries library

Description Usage Arguments Details Value Author(s) See Also Examples

Description

create an fts object by specifying index and data

Usage

1
fts(index,data)

Arguments

index

a vector of dates

data

a matrix, dataframe, or vector

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

Value

a fts object

Author(s)

Whit Armstrong

See Also

as.fts

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
x <- fts(index=seq(from=Sys.Date(),by="months",length.out=24),data=1:24)
y <- fts(index=seq(from=Sys.Date(),by="months",length.out=12),data=13:24)
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)

Example output

Loading required package: zoo

Attaching package: 'zoo'

The following objects are masked from 'package:base':

    as.Date, as.Date.numeric

           [,1]
2019-04-05    1
2019-05-05    2
2019-06-05    3
2019-07-05    4
2019-08-05    5
2019-09-05    6
2019-10-05    7
2019-11-05    8
2019-12-05    9
2020-01-05   10
2020-02-05   11
2020-03-05   12
2020-04-05   13
2020-05-05   14
2020-06-05   15
2020-07-05   16
2020-08-05   17
2020-09-05   18
2020-10-05   19
2020-11-05   20
2020-12-05   21
2021-01-05   22
2021-02-05   23
2021-03-05   24

fts documentation built on May 2, 2019, 9:17 a.m.

Related to fts in fts...