Learn R Programming

fred (version 0.3.1)

fred_first_release: Fetch the first-release ("real-time") version of a series

Description

Returns 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
)

Value

A fred_tbl with columns date, series_id, value, realtime_start, realtime_end.

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

Run this code
# \donttest{
op <- options(fred.cache_dir = tempdir())
try({
  # Initial-release GDP, never revised
  gdp_first <- fred_first_release("GDP", from = "2018-01-01")
})
options(op)
# }

Run the code above in your browser using DataLab