Description Usage Arguments Details Value Functions Examples
View source: R/fred_category.R
Each of the functions accept a category ID and return the requested information in a data.frame.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | fred_category(..., key = NULL)
fred_category_children(
...,
key = NULL,
realtime_start = NULL,
realtime_end = NULL
)
fred_category_related(
...,
key = NULL,
realtime_start = NULL,
realtime_end = NULL
)
fred_category_series(..., key = NULL, args = list())
fred_category_tags(..., key = NULL, args = list())
fred_category_related_tags(..., key = NULL, args = list())
|
... |
character or numeric vectors of a category ID to fetch. Names are ignored. |
key |
32 character lower-cased alpha-numeric character string |
realtime_start, realtime_end |
character date strings of format "YYY-MM-DD" used obtain information that was known during the specified time period. If empty, the latest update of the information is used. |
args |
named list of other arguments passed to the API, including "limit", "offset", "sort_order", etc. See |
Each function returns the following information in a data.frame.
fred_category
Category id, its name, and the id of its parent
fred_category_children
Same as fred_category
fred_category_related
Same as fred_category
fred_category_series
Series id, its title, observations start and end, frequency, units, seasonal adjustment type, popularity, realtime start and end, and when it was last updated
fred_category_tags
Tag name and its group id, popularity of tag, number of series in each tag, when it was created, and other notes
fred_category_related_tags
Same as fred_category_tags
data.frame with entries described in details
fred_category
: get the name and parent_id for a FRED category
fred_category_children
: get the category children ids of a given parent_id
fred_category_related
: get the categories that are related to a category id
fred_category_series
: get all series within a particular category
fred_category_tags
: get all tags associated with a particular category
fred_category_related_tags
: get all tags related to tags within a particular category
1 2 3 4 5 6 7 8 9 10 11 | ## Not run:
api_key <- "abcdefghijklmnopqrstuvwxyz123456"
# What category is the unemployment rate in?
un_cat <- fred_category("UNRATE", key=api_key)
# What other series are in the same category?
other_in_cat <- fred_category_series(un_cat$id, key=api_key)
head(other_in_cat)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.