Learn R Programming

JFE (version 2.5.6)

getFed: Download financial and economic time series data from the Fed

Description

It downloads financial and economic time series data from the Fed.

Usage

getFed(var.name="UNRATE", from="1900-01-01",end=Sys.Date(), do.plot=TRUE)

Value

data

The data retrieved.

Arguments

var.name

The name of variable as used by <"https://fred.stlouisfed.org">. For example, "UNRATE" denotes unemployment rate, "CPIAUCSL" is monthly consumer price index, "GDP" is Gross domestic product, and "ICSA" is the initial claim seasonally adjusted. User please check with the web for symbol.

from

The starting date, the default is 1900-01-01 to ensure the very beginning.

end

The ending date of data retrieved, the default is Sys.Date().

do.plot

Whether to plot the retrieved data, the default is TRUE. Please set this value to be FALSE to avoid too many plotting, if you want to loop more downloads. It applies functionseriesPlot() from package fBasics.

Author

Ho Tsung-wu <tsungwu@ntnu.edu.tw>, College of Management, National Taiwan Normal University.

Details

This function connects with <"https://fred.stlouisfed.org"> and downloads the specified market data. The rownames of downloaded data is embedded by the timestamp already.

Examples

Run this code
#To save time, the example below is commented.
#getFed(var.name="UNRATE")$data

Run the code above in your browser using DataLab