tidyusmacro downloads full flat files from BLS, BEA, and FRED and returns them as tidy data frames, with the lookup tables already joined. One call gets you the entire release, which is what you want for exploratory work, in-depth research, and real-time analysis on data days. BLS and BEA files update right as releases go live; FRED usually follows about 40 minutes later.
getBLSFiles() downloads and processes data from Bureau
of Labor Statistics flat files. Supports CPI, ECI, JOLTS, CPS, CES, and
CEX (Consumer Expenditure Survey). BLS asks for an email address in the
user agent for flat-file downloads.
cpi_data <- getBLSFiles(data_source = "cpi", email = "[email protected]")
jolts_data <- getBLSFiles(data_source = "jolts", email = "[email protected]")getCESRevisions() downloads the revisions table of the
Current Employment Survey (CES) total jobs numbers straight from the BLS
website.
getNIPAFiles() downloads and formats BEA NIPA data flat
files, either monthly or quarterly values.
getPCEInflation() loads and processes Personal
Consumption Expenditures (PCE) inflation data with weights and growth
measures.
getDallasTrimPCE() builds the component-level panel
underlying the Dallas Fed Trimmed Mean PCE inflation rate: monthly price
changes, Fisher expenditure-share weights, and flags for which
components are trimmed each month. Useful for replicating the
trimmed-mean rate or analyzing what gets trimmed.
getFRED() downloads and merges economic data series from
the Federal Reserve Economic Data (FRED) API.
# Named arguments give friendly column names
fred_data <- getFRED(prime_epop = "LNS12300060", cpi = "CPIAUCSL")
# Unnamed arguments use lowercase ticker as column name
fred_data <- getFRED("UNRATE", "PAYEMS")getUnrateFRED() is a convenience function to download
unemployment level and labor force from FRED and calculate the
unemployment rate.
logLinearProjection() performs log-linear projections on
historical data. Designed for use within dplyr verbs.
theme_esp() is a custom ggplot2 theme for Economic
Security Project graphics with cream background and clean styling.
scale_color_esp() and scale_fill_esp()
provide ESP-branded color scales for ggplot2.
date_breaks_gg() creates intelligent date breaks for
ggplot2 that always include the last data point.
ggplot(data, aes(date, value)) +
geom_line() +
scale_x_date(breaks = date_breaks_gg(n = 6, last = max(data$date)))date_breaks_n() generates evenly spaced date breaks by
selecting every nth unique date.
cesDiffusionIndex is a tibble with 250 rows mapping CES
industry codes to industry titles.
dallasTrimPCEcomponents is the 177-component dictionary
used by getDallasTrimPCE(), mapping Dallas Fed trimmed-mean
PCE components to BEA NIPA series codes and line numbers (Table
2.4.4U).