freq: Convert to Specific Frequency

Description Usage Arguments Value Examples

View source: R/helper_functions.R

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') # monthly Civilian Unemployment Rate data
freq(urate, 'y')        # yearly Unemployment Rate

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