Fetch the first-release ("real-time") version of a series
Source:R/vintages.R
fred_first_release.RdReturns only the value that was published when each observation first
appeared in FRED, with no subsequent revisions. Internally this fetches
the full revision history and keeps the earliest realtime_start row
for each observation date. Useful when you want a clean comparison
between what policymakers saw at the time versus what the data look
like after revisions.
Usage
fred_first_release(
series_id,
from = NULL,
to = NULL,
units = "lin",
frequency = NULL,
aggregation = "avg",
cache = TRUE
)Arguments
- series_id
Character. One or more FRED series IDs.
- from, to
Optional observation date range.
- units
Character. Raw FRED units code. Default
"lin".- frequency, aggregation
Optional frequency aggregation arguments (see
fred_series()).- cache
Logical. Cache results locally. Default
TRUE.
See also
Other vintages:
fred_all_vintages(),
fred_as_of(),
fred_real_time_panel()
Examples
# \donttest{
op <- options(fred.cache_dir = tempdir())
# Initial-release GDP, never revised
gdp_first <- fred_first_release("GDP", from = "2018-01-01")
#> Error in fred_get_key(): No FRED API key found.
#> ℹ Set one with `fred_set_key()` or the `FRED_API_KEY` environment variable.
#> ℹ Register for a free key at <https://fredaccount.stlouisfed.org/apikeys>.
options(op)
# }