R/fredr_category_related.R
fredr_category_related.Rd
Get the related categories for a FRED category.
fredr_category_related(
category_id,
...,
realtime_start = NULL,
realtime_end = NULL
)
An integer ID for the category. Default is 0
for the
root category. Required parameter.
These dots only exist for future extensions and should be empty.
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 containing the name and parent ID for categories
related to the category indicated by category_id
.
From the FRED API documentation: "A related category is a one-way relation between 2 categories that is not part of a parent-child category hierarchy. Most categories do not have related categories."
if (fredr_has_key()) {
# Categories related to the "Employment Cost Index" category
fredr_category_related(category_id = 4L)
}
#> # A tibble: 1 × 3
#> id name parent_id
#> <int> <chr> <int>
#> 1 10 Population, Employment, & Labor Markets 0