library(fredr)
This vignette is intended to introduce the user to fredr functions for the Tags endpoint of the FRED API.
FRED series are assigned tags as an attribute for classification. Each FRED tag is identified by a string ID. For example:
The following examples illustrate usage of the Tags endpoint functions in fredr.
The function fredr_tags_series()
returns a list of series assigned tags matching the request. As with the functions for the Series endpoint, the data returned is a tibble in which each row represents a series. For example, to get all series tagged with "gdp"
:
fredr_tags_series(tag_names = "gdp")
#> # A tibble: 1,000 x 16
#> id realtime_start realtime_end title observation_sta… observation_end
#> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 A001… 2021-01-29 2021-01-29 Gros… 1929-01-01 2019-01-01
#> 2 A001… 2021-01-29 2021-01-29 Gros… 1929-01-01 2019-01-01
#> 3 A001… 2021-01-29 2021-01-29 Gros… 1930-01-01 2019-01-01
#> 4 A001… 2021-01-29 2021-01-29 Gros… 1947-04-01 2020-07-01
#> 5 A001… 2021-01-29 2021-01-29 Real… 1930-01-01 2019-01-01
#> 6 A001… 2021-01-29 2021-01-29 Real… 1947-04-01 2020-07-01
#> 7 A001… 2021-01-29 2021-01-29 Real… 1948-01-01 2020-07-01
#> 8 A001… 2021-01-29 2021-01-29 Gros… 1930-01-01 2019-01-01
#> 9 A001… 2021-01-29 2021-01-29 Gros… 1947-04-01 2020-07-01
#> 10 A001… 2021-01-29 2021-01-29 Gros… 1930-01-01 2019-01-01
#> # … with 990 more rows, and 10 more variables: frequency <chr>,
#> # frequency_short <chr>, units <chr>, units_short <chr>,
#> # seasonal_adjustment <chr>, seasonal_adjustment_short <chr>,
#> # last_updated <chr>, popularity <int>, group_popularity <int>, notes <chr>
To get the top 100 most popular non-quarterly series tagged with "gdp"
:
fredr_tags_series(
tag_names = "gdp",
exclude_tag_names = "quarterly",
order_by = "popularity",
limit = 100L
)#> # A tibble: 100 x 16
#> id realtime_start realtime_end title observation_sta… observation_end
#> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 H407… 2021-01-29 2021-01-29 Comp… 1929-01-01 1948-01-01
#> 2 B407… 2021-01-29 2021-01-29 Comp… 1987-01-01 2000-01-01
#> 3 N404… 2021-01-29 2021-01-29 Comp… 1998-01-01 2019-01-01
#> 4 B405… 2021-01-29 2021-01-29 Comp… 1987-01-01 2000-01-01
#> 5 H405… 2021-01-29 2021-01-29 Comp… 1929-01-01 1948-01-01
#> 6 J405… 2021-01-29 2021-01-29 Comp… 1948-01-01 1969-01-01
#> 7 B490… 2021-01-29 2021-01-29 Empl… 1987-01-01 2000-01-01
#> 8 J491… 2021-01-29 2021-01-29 Empl… 1948-01-01 1987-01-01
#> 9 B480… 2021-01-29 2021-01-29 Empl… 1948-01-01 1987-01-01
#> 10 J481… 2021-01-29 2021-01-29 Empl… 1948-01-01 1987-01-01
#> # … with 90 more rows, and 10 more variables: frequency <chr>,
#> # frequency_short <chr>, units <chr>, units_short <chr>,
#> # seasonal_adjustment <chr>, seasonal_adjustment_short <chr>,
#> # last_updated <chr>, popularity <int>, group_popularity <int>, notes <chr>