rebase: Change the base year

Description Usage Arguments Value Examples

View source: R/01-basic.R

Description

Maturing lifecycle

Change the base year.

Usage

1
2
3

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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

kvasilopoulos/transx documentation built on Jan. 26, 2021, 6:14 p.m.