freq: Convert to Specific Frequency

Description Usage Arguments Value Examples

Description

freq converts an 'xts' time series object to a different time frequency.

Usage

1
freq(x, freq = "q", OHLC = FALSE)

Arguments

x

'xts' object

freq

frequency which to convert. Accepts 'y', 'q', 'm', 'w', or 'd' for dates. Also accepts 'h', '30m', '15m', '10m', '5m', '3m', and 'mn' for times.

OHLC

logical describing whether to keep the Open, High, Low, and Close of data after conversion. Defaults to FALSE.

Value

'xts' object

Examples

1
2
urate <- fred('UNRATE', as_xts=TRUE) # monthly Civilian Unemployment Rate data
freq(urate, 'y')        # yearly Unemployment Rate

cmann3/econ311 documentation built on May 31, 2019, 1:14 p.m.