YoY: Calculates growth

Description Usage Arguments Value Note Author(s) Examples

View source: R/v2_aux.R

Description

Year over year growth (or versus any period)

Usage

1
YoY(serie, lapso, decimal = TRUE)

Arguments

serie

numeric vector or series

lapso

period separations (12 = for monthly data, 4 = quaterly data)

decimal

Should result be in decimals? Default = TRUE. False returns percents x 100.

Value

Vector numeric

Note

Vector must be in ascending order (oldest to newest). The inegi_series() function returns in that order.

Author(s)

Eduardo Flores

Examples

1
2
3
4
5
6
7
# Calculate inflation
## Not run: 
token <- "webservice_token"
INPC <- serie_inegi(INPC, token)
Inflation <- YoY(INPC$Valores, 12)

## End(Not run)

inegiR documentation built on April 1, 2018, 12:21 p.m.