fredr_series_search: Search for a FRED series.

Description Usage Arguments Value References See Also Examples

Description

Search FRED for a series by full text of series or by series ID.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
fredr_series_search_text(
  search_text,
  ...,
  tag_names = NULL,
  exclude_tag_names = NULL,
  filter_variable = NULL,
  filter_value = NULL,
  limit = NULL,
  offset = NULL,
  order_by = NULL,
  sort_order = NULL,
  realtime_start = NULL,
  realtime_end = NULL
)

fredr_series_search_id(
  search_text,
  ...,
  limit = 1000L,
  offset = 0,
  order_by = NULL,
  sort_order = "asc",
  filter_variable = NULL,
  filter_value = NULL,
  realtime_start = NULL,
  realtime_end = NULL,
  tag_names = NULL,
  exclude_tag_names = NULL
)

Arguments

search_text

A string containing the words to match against economic data series. For use with fredr_series_search_text and fredr_series_search_id.

...

These dots only exist for future extensions and should be empty.

tag_names

A semicolon delimited string of tag names that series match all of. Defaults to no tag filtering.

exclude_tag_names

A semicolon delimited string of tag names that series match none of. Defaults to no tag filtering.

filter_variable

A string indicating the attribute to filter results by. Possible values are: "frequency", "units", "seasonal_adjustment". Defaults to no filter.

filter_value

The value of the filter_variable attribute to filter by. Possible values depend on the value of filter_variable. Defaults to no filter.

limit

An integer limit on the maximum number of results to return. Defaults to 1000, the maximum.

offset

An 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_by

A string indicating the attribute to order results by. Defaults to "search_rank" for fredr_series_search_text() and "series_id" for fredr_series_search_id(). Possible values are:

  • "search_rank"

  • "series_id"

  • "title"

  • "units"

  • "frequency"

  • "seasonal_adjustment"

  • "realtime_start"

  • "realtime_end"

  • "last_updated"

  • "observation_start"

  • "observation_end"

  • "popularity"

  • "group_popularity"

sort_order

A string representing the order of the resulting series. Possible values are: "asc" (default), and "desc".

realtime_start

A Date indicating the start of the real-time period. Defaults to today's date. For more information, see Real-Time Periods.

realtime_end

A Date indicating the end of the real-time period. Defaults to today's date. For more information, see Real-Time Periods.

Value

A tibble object where each row represents a series matching the query.

References

API Documentation:

series/search

See Also

fredr_series_observations(), fredr_series_search_tags(), fredr_series_search_related_tags(), fredr_series(), fredr_series_categories(), fredr_series_release(), fredr_series_tags(), fredr_series_updates(), fredr_series_vintagedates().

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
if (fredr_has_key()) {
# search for series with text matching "oil" and return the top 10 most popular
# series
fredr_series_search_text(
  search_text = "oil",
  order_by = "popularity",
  limit = 10
)
# search for series with text matching "oil" with the tag "usa" and return the
# top 10 search results
fredr_series_search_text(
  search_text = "oil",
  order_by = "search_rank",
  limit = 10,
  tag_names = "usa"
)
# search for series with text matching "unemployment" and return only series
# with monthly frequency
fredr_series_search_text(
  search_text = "unemployment",
  filter_variable = "frequency",
  filter_value = "Monthly"
)
# search for series ID matching "UNRATE" and return oldest series first
fredr_series_search_id(
  search_text = "UNRATE",
  order_by = "observation_start"
)
}

sboysel/fredr documentation built on Aug. 15, 2021, 9:19 a.m.