Coerce an bts
object into a data frame
# S3 method for bts
as.data.frame(x, row.names = NULL, optional = FALSE, longFormat = FALSE, ...)
An object with class bts
representing a by-block time
series.
Not used.
Not used.
Logical. With the default FALSE
, the
result has the same columns as x
plus the new column
Date
. When longFormat
is TRUE
, the data frame
is in "long format" with all the columns of x
given in same
the column value
of the result. A column type
indicates
the name of the original column in x
.
Not used yet.
A dataframe with a Date
column containing the value
of the "date"
attribute of x
.
myDate <- seq(from = as.Date("1996-01-01"),
to = as.Date("2016-12-31"), by = "years")
X <- polynomX(myDate)
df <- as.data.frame(X)
head(df)
#> Date Cst t1 t2
#> 1 1996-01-01 1 25.99863 675.9288
#> 2 1997-01-01 1 27.00068 729.0370
#> 3 1998-01-01 1 28.00000 784.0000
#> 4 1999-01-01 1 28.99932 840.9603
#> 5 2000-01-01 1 29.99863 899.9179
#> 6 2001-01-01 1 31.00068 961.0424