Description Usage Arguments Details Value Examples
FREDcat
returns a data frame with info on series
1 | FREDcat(catvec, key)
|
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 |
Queries the FRED API to get the requested data
data frame
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.