Description Usage Arguments Details Value Author(s) See Also Examples
Constructor function for creating an extensible time-series data.frame object.
xtsdf
is used to create an xtsdf
object from raw data inputs and as.xtsdf
is used for coercion to the same.
1 2 3 4 5 |
... |
Columns of the resulting |
order.by |
a corresponding vector of unique times/dates - must be
of a known time-based class. See details of |
frequency |
numeric indicating frequency of |
unique |
Logical. Should index be checked for unique time-stamps? |
tzone |
time zone of series |
stringsAsFactors |
Logical. Should strings be converted to factors? Note that |
check.names |
Logical. Should column names be made syntactically correct? |
x |
An object to be tested or coerced to class |
An xtsdf
object creates a time ordered data.frame
like object; internally it is implemented as a list of xts
objects, but it should behave like a data.frame
rather transparently. The class is still under heavy development and feedback is welcome. Imporantly, this now allows xts
-like behavior for objects with different column classes.
Subsetting inherits ISO8601 subsetting from xts
as well as standard R subsetting. Double bracket ([[
) subsetting inherits from the underlying list structure. Note that the default for subsetting is drop = FALSE
following xts
rather than data.frame
. This is subject to change.
An S3 object of class xtsdf
.
Michael Weylandt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | data(sample_matrix)
sample.xtsdf <- xtsdf(fac = letters[sample(26, 100, replace = TRUE)], x = rnorm(100), y = abs(rnorm(100)), order.by = as.Date("2012-06-19") + 1:100)
class(sample.xtsdf)
str(sample.xtsdf)
head(sample.xtsdf)
sample.xtsdf['2012'] # all of 2012
sample.xtsdf['2007-07/'] # July 2012 to the end of the data set
sample.xtsdf['2007-07/2007-08'] # March 2007 to August of 2007
sample.xtsdf['/'] # the whole data set
sample.xtsdf[["x"]]
sample.xtsdf[,"fac"]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.