This vignette is intended to introduce the user to fredr functions for the Categories endpoint of the FRED API.
FRED series are assigned categories. Each FRED category is assigned an integer identifier. For example:
category_id = 10
)category_id = 32992
)category_id = 1
)category_id = 97
)Categories are organized in a hierarchical structure where parent
categories contain children categories. All categories are children of
the root category (category_id = 0
). The following examples
illustrate usage of the Categories endpoint functions in fredr.
fredr_category()
returns minimal information for a
single category specified by category_id
. The data returned
is a tibble
in which each row represents a category.
fredr_category_children()
returns minimal information
(child ID, name, and parent ID) for all child categories of the parent
category specified by category_id
. The data returned is a
tibble in which each row represents child category of the parent
specified.
fredr_category_series()
returns detailed information for
the FRED series belonging to the category specified by
category_id
. The data returned is a tibble in which each
row represents a series belonging to the category specified. For
example, to get the top 100 quarterly series in the “Housing” category,
ordering the results so that the most recently updated series appear
first:
fredr_category_series(
category_id = 97L, # Housing
limit = 100L,
order_by = "last_updated",
filter_variable = "frequency",
filter_value = "Quarterly"
)
To return all series in the “National Accounts” category tagged with
"usa"
and not "gnp"
, ordering the
results such that higher frequency series appear first: