Learn R Programming

fred (version 0.3.1)

fred_manifest: Snapshot a session's FRED downloads as a YAML manifest

Description

Produces a YAML manifest describing one or more fred_tbl objects, with query metadata, dimensions, date ranges, and an MD5 hash of each object. Intended to be saved alongside paper code for reproducibility checks: if the manifest still hashes to the same values, the data underlying the analysis has not changed.

Usage

fred_manifest(..., file = NULL)

Value

A fred_manifest object (a character string with an attached print method). If file is supplied, written to disk and returned invisibly.

Arguments

...

fred_tbl objects (positional or named) or a single list of fred_tbl objects.

file

Optional path to write the YAML manifest. If NULL (default), the manifest is returned as a fred_manifest object (printable).

Details

Pass fred_tbl objects positionally, named, or as a list. If passed a bare list, names from the list are used; otherwise objects are labelled obj_1, obj_2, ...

See Also

Other reproducibility: fred_cite_series(), fred_vintage_revisions()

Examples

Run this code
# \donttest{
op <- options(fred.cache_dir = tempdir())
try({
  if (FALSE) {
  gdp <- fred_series("GDPC1", from = "2020-01-01")
  un  <- fred_series("UNRATE", from = "2020-01-01")
  m <- fred_manifest(gdp = gdp, unrate = un)
  print(m)
  fred_manifest(gdp = gdp, file = file.path(tempdir(), "manifest.yml"))
  }
})
options(op)
# }

Run the code above in your browser using DataLab