Skip to contents

Extract the first/last parts of an index as if it were a matrix.

Usage

# S3 method for piar_index
head(x, n = 6L, ...)

# S3 method for piar_index
tail(x, n = 6L, ...)

Arguments

x

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

n

See head()/tail(). The default takes the first/last 6 levels of x.

...

Not currently used.

Value

A price index that inherits from the same class as x.

Examples

index <- as_index(matrix(1:9, 3))

head(index, 1)
#> Period-over-period price index for 1 levels over 3 time periods 
#>   1 2 3
#> 1 1 4 7

tail(index, 1)
#> Period-over-period price index for 1 levels over 3 time periods 
#>   1 2 3
#> 3 3 6 9