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:
fredr_sources()
#> # A tibble: 87 x 6
#> id realtime_start realtime_end name link notes
#> * <int> <chr> <chr> <chr> <chr> <chr>
#> 1 1 2018-07-22 2018-07-22 Board of Governors… http://www… <NA>
#> 2 3 2018-07-22 2018-07-22 Federal Reserve Ba… http://www… <NA>
#> 3 4 2018-07-22 2018-07-22 Federal Reserve Ba… http://www… <NA>
#> 4 6 2018-07-22 2018-07-22 Federal Financial … http://www… <NA>
#> 5 11 2018-07-22 2018-07-22 Dow Jones & Company http://www… <NA>
#> 6 14 2018-07-22 2018-07-22 University of Mich… https://ww… <NA>
#> 7 15 2018-07-22 2018-07-22 Council of Economi… http://www… <NA>
#> 8 16 2018-07-22 2018-07-22 U.S. Office of Man… http://www… <NA>
#> 9 17 2018-07-22 2018-07-22 U.S. Congressional… http://www… <NA>
#> 10 18 2018-07-22 2018-07-22 U.S. Bureau of Eco… http://www… <NA>
#> # ... with 77 more rows
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
:
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
)
#> # A tibble: 10 x 7
#> id realtime_start realtime_end name press_release link notes
#> * <int> <chr> <chr> <chr> <lgl> <chr> <chr>
#> 1 13 2018-07-22 2018-07-22 G.17 In… TRUE http:… <NA>
#> 2 14 2018-07-22 2018-07-22 G.19 Co… TRUE http:… <NA>
#> 3 15 2018-07-22 2018-07-22 G.5 For… TRUE http:… <NA>
#> 4 17 2018-07-22 2018-07-22 H.10 Fo… TRUE http:… <NA>
#> 5 18 2018-07-22 2018-07-22 H.15 Se… TRUE http:… <NA>
#> 6 19 2018-07-22 2018-07-22 H.3 Agg… TRUE http:… <NA>
#> 7 20 2018-07-22 2018-07-22 H.4.1 F… TRUE http:… <NA>
#> 8 21 2018-07-22 2018-07-22 H.6 Mon… TRUE http:… <NA>
#> 9 22 2018-07-22 2018-07-22 H.8 Ass… TRUE http:… <NA>
#> 10 52 2018-07-22 2018-07-22 Z.1 Fin… TRUE http:… "The F…
To get University of Michigan releases since 1950:
fredr_source_releases(
source_id = 14L,
realtime_start = as.Date("1950-01-01")
)
#> # A tibble: 2 x 6
#> id realtime_start realtime_end name press_release link
#> * <int> <chr> <chr> <chr> <lgl> <chr>
#> 1 91 1998-07-31 2006-12-31 Surveys o… TRUE http://www.s…
#> 2 91 2007-01-01 9999-12-31 Surveys o… TRUE http://www.s…