library(fredr) knitr::opts_chunk$set( fig.width = 7, fig.height = 5, eval = fredr_has_key(), collapse = TRUE, comment = "#>" )
library(fredr)
This vignette is intended to introduce the user to fredr functions for the Sources endpoint of the FRED API.
FRED series are derived from a specific data source. Each FRED source is assigned an integer identifier. The following examples illustrate usage of the Sources endpoint functions in fredr.
The function fredr_sources()
returns a list of FRED data sources. The information returned is a tibble in which each row represents a FRED source. For example, running fredr_sources()
without any arguments returns the first 1000 (limit
default) sources ordered by ascending source ID (but here we limit to just 10):
fredr_sources(limit = 10)
The function fredr_source()
returns information for a single source indicated by source_id
. The data returned is a tibble in which each row represents a FRED source. For example, the Federal Financial Institutions Examination Council source ID is 6
:
fredr_source(source_id = 6L)
The function fredr_source_releases()
returns FRED release information for the source indicated by source_id
. As with the functions for the Releases endpoint, the data returned is a tibble in which each row represents a FRED release for the specified source. For example, to get the first 10 releases from the Federal Reserve Board of Governors, ordered by ascending release ID:
fredr_source_releases( source_id = 1L, limit = 10L )
To get University of Michigan releases since 1950:
fredr_source_releases( source_id = 14L, realtime_start = as.Date("1950-01-01") )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.