as.data.frame.piar_index | R Documentation |
Turn an index into a data frame or a matrix.
## S3 method for class 'piar_index'
as.data.frame(
x,
row.names = NULL,
optional = FALSE,
...,
contrib = FALSE,
stringsAsFactors = FALSE
)
## S3 method for class 'piar_index'
as.matrix(x, ...)
x |
A price index, as made by, e.g., |
row.names , stringsAsFactors |
See |
optional |
Not currently used. |
... |
Not currently used. |
contrib |
Include percent-change contributions (the default does not include them). |
as.data.frame()
returns the index values in x
as a data frame with three
columns: period
, level
, and value
. If contrib = TRUE
then there is
a fourth (list) column contrib
containing percent-change contributions.
as.matrix()
returns the index values in x
as a matrix with a row for
each level and a column for each time period in x
.
as_index()
to coerce a matrix/data frame of index values into an index
object.
Other index methods:
[.piar_index()
,
aggregate.piar_index
,
as.ts.piar_index()
,
chain()
,
contrib()
,
head.piar_index()
,
is.na.piar_index()
,
levels.piar_index()
,
mean.piar_index
,
merge.piar_index()
,
split.piar_index()
,
stack.piar_index()
,
time.piar_index()
,
window.piar_index()
index <- as_index(matrix(1:6, 2))
as.data.frame(index)
as.matrix(index)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.