head.piar_index: Return the first/last parts of an index

View source: R/head.piar_index.R

head.piar_indexR Documentation

Return the first/last parts of an index

Description

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

Usage

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

## S3 method for class '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.

See Also

Other index methods: [.piar_index(), aggregate.piar_index, as.data.frame.piar_index(), as.ts.piar_index(), chain(), contrib(), 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()

Examples

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

head(index, 1)

tail(index, 1)


piar documentation built on April 3, 2025, 7:38 p.m.