View source: R/miscellaneous.R
idx | R Documentation |
The index of a dfidx
is a data.frame containing the different
series which define the two indexes (with possibly a nesting
structure). It is stored as a "sticky" data.frame column of the
data.frame and is also inherited by series (of class 'xseries'
)
which are extracted from a dfidx
.
idx(x, n = NULL, m = NULL)
## S3 method for class 'dfidx'
idx(x, n = NULL, m = NULL)
## S3 method for class 'idx'
idx(x, n = NULL, m = NULL)
## S3 method for class 'xseries'
idx(x, n = NULL, m = NULL)
## S3 method for class 'idx'
format(x, size = 4, ...)
x |
a |
n , m |
|
size |
the number of characters of the indexes for the format method |
... |
further arguments (for now unused) |
idx is defined as a generic with a dfidx
and a xseries
method.
a data.frame
containing the indexes or a series if a
specific index is selected
Yves Croissant
mn <- dfidx(munnell, idx = c(region = "state", president = "year"))
idx(mn)
gsp <- mn$gsp
idx(gsp)
# get the first index
idx(mn, 1)
# get the nesting variable of the first index
idx(mn, 1, 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.