fred_loop: Function to download a variable from FRED for multiple...

Description Usage Arguments Examples

Description

Function to download a variable from FRED for multiple countries

Usage

1
fred_loop(prefix, suffix, iso2c, var_name, single_symbol)

Arguments

prefix

character string FRED symbol prefix.

suffix

character string FRED symbol suffix.

iso2c

character vector of ISO two letter country codes.

var_name

character string of the name for the downloaded variable.

single_symbol

a character string of a single FRED symbol to download only one series. Note: do not use with prefix, suffix, iso2c. Note, will not return a column with the ISO two letter country code.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
#' # Download Central government debt, total (% of GDP) for Ireland
fred_loop(prefix = 'DEBTTL', suffix = 'A188A', iso2c = 'IE',
          var_name = 'pubdebtgdp_cent_fred')

## Not run: 
# Download Central government debt, total (% of GDP) for Ireland and Japan
fred_loop(prefix = 'DEBTTL', suffix = 'A188A', iso2c = c('IE', 'JP'),
          var_name = 'pubdebtgdp_cent_fred')

## End(Not run)

# Download single series (US Federal Funds Rate)
fred_loop(single_symbol = 'FEDFUNDS', var_name = 'us_fed_funds')

christophergandrud/fredr documentation built on May 13, 2019, 7:02 p.m.