as.data.frame.piar_index {piar}R Documentation

Coerce an index into a tabular form

Description

Turn an index into a data frame or a matrix.

Usage

## S3 method for class 'piar_index'
as.data.frame(x, ..., stringsAsFactors = FALSE)

## S3 method for class 'piar_index'
as.matrix(x, ...)

Arguments

x

A price index, as made by, e.g., elemental_index().

...

Not currently used.

stringsAsFactors

See as.data.frame().

Value

as.data.frame() returns a data frame with three columns: period, level, and value.

as.matrix() returns a matrix with a row for each level and a column for each time period.

See Also

as_index() to coerce a matrix/data frame of index values into an index object.

Other index methods: [.piar_index(), aggregate.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(), vcov.aggregate_piar_index()

Examples

index <- as_index(matrix(1:6, 2))

as.data.frame(index)
as.matrix(index)


[Package piar version 0.7.0 Index]