FRED Categories

Sam Boysel

2018-07-22

Introduction

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:

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.

Get a FRED category

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. The default is the root category.

Get the children of a FRED 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. The default is the root category.

Get series in a category

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. The default is the root category. 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:

To return all series in the “National Accounts” tagged with “usa” and not “gnp”, ordering the results such that higher frequency series appear first:

Get tags within a FRED category

fredr_category_tags() returns information for the FRED tags assigned to series in the category specified by category_id. The data returned is a tibble in which each row represents a tag assigned to a series in the category specified. The default is the root category. For example, to get all “source” tags belonging to series in the “Retail Trade” category:

To search for tags with the words “usa” in the “Production & Business Activity” category, ordering the results by popularity: