Get the FRED tags for a category. Optionally, filter results by tag name,
tag group, or search. Series are assigned tags and categories. Alternatively,
it is possible to get the tags for a category through a call to a function in
the fredr/series
endpoint. See fredr_series. No tags exist for a category
that does not have series.
fredr_category_tags(
category_id,
...,
tag_names = NULL,
tag_group_id = NULL,
search_text = NULL,
limit = NULL,
offset = NULL,
order_by = NULL,
sort_order = NULL,
realtime_start = NULL,
realtime_end = NULL
)
An integer ID for the category.
These dots only exist for future extensions and should be empty.
A string indicating which series tags to match. Multiple
tags can be delimited by a semicolon in a single string (e.g. "usa;gnp"
).
A string representing the tag group id to filter tags by type. No filtering by default. Possible values include:
"freq"
- Frequency
"gen"
- General or Concept
"geo"
- Geography
"geot"
- Geography Type
"rls"
- Release
"seas"
- Seasonal Adjustment
"src"
- Source
A string to match text of tags. No matching by default.
An positive integer indicating maximum number of results to return. Possible
values are any integer between 1
and 1000
(default), inclusive.
An non-negative integer used in conjunction with limit
for
long series. This mimics the idea of pagination to retrieve large amounts
of data over multiple calls. Defaults to 0
.
Order results by values of the specified attribute.
Possible values include: "series_count"
(default), "popularity"``,
"created",
"name",
"group_id"`.
A string representing the order of the resulting series.
Possible values are: "asc"
(default), and "desc"
.
A Date
indicating the start of the real-time period.
Defaults to today's date. For more information, see
Real-Time Periods.
A Date
indicating the end of the real-time period.
Defaults to today's date. For more information, see
Real-Time Periods.
A tibble
object information on tags matching the request and their
descriptions. Data include tag name, group ID, popularity, series count, tag
creation date, and additional notes.
if (fredr_has_key()) {
# Tags assigned to series in the "Production & Business Activity" category
fredr_category_tags(category = 1L)
# Select the "nation" and "monthly" tags in the "Production & Business Activity" category
fredr_category_tags(category = 3L, tag_names = "nation;monthly", order_by = "popularity")
}
#> # A tibble: 2 × 6
#> name group_id notes created popularity series_count
#> <chr> <chr> <chr> <chr> <int> <int>
#> 1 nation geot "" 2012-02-27 10:18:19-06 99 2632
#> 2 monthly freq "" 2012-02-27 10:18:19-06 94 1250