G: Growth Rate of a Time Series

Description Usage Arguments Value Examples

View source: R/ts_lag_ops.R

Description

G calculates the growth rate of an 'xts' time series.

Usage

1
G(x, lag = 1)

Arguments

x

'xts' time series variable

lag

numeric or character value indicating the number of periods between which the time series grew

Value

'xts' object of growth rates.

Examples

1
2
3
4
5
Y <- pwt(country = 'USA', series = 'gdp')
g_Y <- G(Y)      # 1 period growth rate of GDP
y_Y <- G(Y, 'y') # yearly growth rate of GDP
m_Y <- G(Y, '6m') # 6 month growth rate of GDP
#Table(Y, g_y, y_Y, m_Y)

cmann3/recon documentation built on May 13, 2019, 8:23 p.m.