jubilee.read_fred_file: Internal utility to read FRED file

Description Usage Arguments Value Author(s) Examples

View source: R/jubilee-read-fred-file.R

Description

This utility reads the internal static file, optionally amends with FRED online data, and returns the values of a given symbol.

Usage

1
2
jubilee.read_fred_file(fraction, local_file, symbol, online = FALSE,
  daily_symbol = NULL, period = "M")

Arguments

fraction

numeric, the fraction to return the value. The utility will lookup within a month to find value. For debug purpose, set it to NULL, and the intermediate data table will be returned.

local_file

character, the file name of an internal file. For debug purpose, set it to NULL, and the process will initiate the source data from FRED via symbol, instead of a local file.

symbol

character, the FRED symbol.

online

logical, whether to fetch online data from FRED. Default is FALSE.

daily_symbol

character, the FRED symbol to read daily data that supplements the monthly data. Default is NULL.

period

charater, length-1 string indicating the data period of the symbol. M is monthly, Q is quarterly. Default is M.

Value

The values of the symbol, numeric with the same length as fraction.

Author(s)

Stephen H. Lihn

Examples

1
2
3
4
5
6
## Not run: 
  repo <- jubilee.repo(online=FALSE)
  a <- jubilee.read_fred_file(repo@ie$fraction, "BAA.csv", "BAA")
  tail(a)

## End(Not run)

jubilee documentation built on Jan. 24, 2020, 5:10 p.m.