Learn R Programming

transx (version 0.0.1)

rebase: Change the base year

Description

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

Run this code
# NOT RUN {
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
# }

Run the code above in your browser using DataLab