rebase {transx}R Documentation

Change the base year

Description

Maturing lifecycle

Change the base year.

Usage

rebase(x, n = NULL)

rebase_origin(x)

Arguments

x

⁠[univariate vector]⁠

Univariate vector, numeric or ts object with only one dimension.

n

⁠[numeric(1): NULL]⁠

The index of the new base year.

Value

Returns a vector with the same class and attributes as the input vector.

Examples


x <- 3:10

# New base  would be 5
rebase(x, 5)

# Or the origin
rebase_origin(x)

# Fro the base to be 100 or 0 then:
rebase(x, 5)*100
rebase(x, 5) - 1

[Package transx version 0.0.1 Index]