Learn R Programming

fred (version 0.3.1)

fred_real_time_panel: Fetch a real-time panel of a series across selected vintages

Description

Returns the values that were available on each of a chosen set of vintage dates. This is the FRED API's vintage_dates parameter: instead of asking for every revision (potentially huge), you ask for only the snapshots you care about, e.g. quarterly vintages aligned to GDP release dates.

Usage

fred_real_time_panel(
  series_id,
  vintages,
  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.

vintages

Character or Date vector. Vintage dates to fetch.

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_first_release()

Examples

Run this code
# \donttest{
op <- options(fred.cache_dir = tempdir())
try({
  # GDP as published at three quarterly snapshots
  gdp_panel <- fred_real_time_panel(
  "GDP",
  vintages = c("2023-04-30", "2023-07-31", "2023-10-31")
  )
})
options(op)
# }

Run the code above in your browser using DataLab