Description Usage Arguments Details Value Functions Examples
Function that fetches data series with related codes and places the results into a long data.frame.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
id |
character string containing the common series id segment |
groups |
character vector denoting the variation in the series |
type |
how should the group vectors be combined with the id? |
key |
32 character lower-cased alpha-numeric character string |
name |
character string describing the name of the value column. If |
grp_name |
character string describing the name of the group column. Defaults to |
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. |
The fred_group
command is convenience function that searches for many
different series at once and places them in a panel. This is similar to the
fred
command except that it can be more convenient when the series
are related to each other. For example, the statewide unemployment rates from
the Bureau of Labor Statistics have all codes with the format: "<State Abbreviation><UR>"
.
If state abbreviations are located in variable state.abb
, then the command
fred_group("UR", state.abb, "prefix", key)
would search place all unemployment
rates into a data.frame.
fred_state
is a wrapper around fred_group
with the state abbreviations
used for groups and with the group column "state"
.
data.frame
fred_state
: Fetch data across each state
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## Not run:
api_key <- "abcdefghijklmnopqrstuvwxyz123456"
# Panel of Unemployment Rates Across States
unemploy <- fred_state("UR", key = api_key)
unemploy
# Panel of Constant GDP per Capita by Country
GDP <- fred_group("NYGDPPCAPKD", eFRED::countries, type="postfix",
key=api_key, name= "gdppc", grp_name="country")
GDP
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.