| ts_table | R Documentation |
Create a ts_table.
ts_table(data, timestamp, columns)
data |
numeric |
timestamp |
|
columns |
column names |
Create a time-series table (ts_table). A
ts_table is a numeric matrix, so there is
always a dim attribute. For a ts_table
x, you get the number of observations with
dim(x)[1L].
Attached to this matrix are several attributes:
a vector: the numeric representation of the timestamp
character: the class of the original
timestamp, either Date or POSIXct
a character vector that provides the columns names
There may be other attributes as well, but these three are always present.
Timestamps must be of class Date or
POSIXct (POSIXlt is
converted). A tzone attribute is dropped.
A ts_table is not meant as a time-series
class. For most computations (plotting, calculation
of statistics, etc.), the ts_table must first
be coerced to zoo, xts, a
data.frame or a similar data
structure. Methods that perform such coercions are
responsible for converting the numeric timestamp
vector to an actual timestamp. For this, they may use
the function ttime (‘translate time’).
a ts_table
Enrico Schumann
as.ts_table
ts_table(1:5, Sys.Date() - 5:1, columns = "value")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.