FREDcat: Get info on variables in one or more FRED categories

Description Usage Arguments Details Value Examples

Description

FREDcat returns a data frame with info on series

Usage

1
FREDcat(catvec, key)

Arguments

catvec

numeric vector with list of FRED categories to get info for

key

Your FRED API key (can be obtained for free - check http://api.stlouisfed.org/api_key.html) default returns data frame with info on series available in one or several categories

Details

Queries the FRED API to get the requested data

Value

data frame

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
require(dplyr)
df <- FREDcat(c(106, 125))
df <- FREDcat(18) # 18 is NIPA, so this will get info on ALL series in the NIPA category and its children
df2 <- df %>% filter(grepl("Billions of Chained 2009 Dollars", units),
              grepl("consumption", title, ignore.case=TRUE),
              grepl("durable", title, ignore.case=TRUE)) %>%
       select(cat, id, title, frequency_short, seasonal_adjustment_short, units_short)
# Look at df2 in the viewer to find the desired consumption variables
# Let's look at PCDGCC96 real quarterly durables, and PCNDGC96 real q nondurables
head(df)
count(df, id, title)
vars <- c("PCDGCC96", "PCNDGC96")
FRED(vars)

## End(Not run)

donboyd5/apitools documentation built on May 15, 2019, 10:38 a.m.