-
Notifications
You must be signed in to change notification settings - Fork 21
/
README.Rmd
103 lines (73 loc) · 3.21 KB
/
README.Rmd
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
---
output: github_document
editor_options:
chunk_output_type: console
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# fredr
<!-- badges: start -->
[![Codecov](https://img.shields.io/codecov/c/github/sboysel/fredr/master.svg)](https://codecov.io/github/sboysel/fredr)
[![CRAN](https://img.shields.io/cran/v/fredr.svg)](https://cran.r-project.org/package=fredr)
[![CRAN Downloads](https://cranlogs.r-pkg.org/badges/fredr)](https://cran.r-project.org/package=fredr)
[![R-CMD-check](https://github.com/sboysel/fredr/workflows/R-CMD-check/badge.svg)](https://github.com/sboysel/fredr/actions)
<!-- badges: end -->
fredr provides a complete set of R bindings to the [Federal Reserve of Economic
Data (FRED)](https://fred.stlouisfed.org/) RESTful API, provided by
the Federal Reserve Bank of St. Louis. The functions allow the user to search
for and fetch time series observations as well as associated metadata within
the FRED database.
The core function in this package is `fredr()`, which fetches observations
for a FRED series. That said, there are many other FRED endpoints exposed
through fredr, such as `fredr_series_search_text()`, which allows you to
search for a FRED series by text.
We strongly encourage referencing the FRED API
[documentation](https://fred.stlouisfed.org/docs/api/fred/) to
leverage the full power of fredr.
You'll also need a free API key to use fredr. See `?fredr_set_key()`.
## Installation
You can download fredr from CRAN with:
```{r, eval=FALSE}
install.packages("fredr")
```
To get the development version of the package:
```{r, eval=FALSE}
# install.packages("devtools")
devtools::install_github("sboysel/fredr")
```
## Example
You can use `fredr()` to fetch series from FRED. This fetches the US unemployment rate series from 1990-2000.
```{r}
library(fredr)
fredr(
series_id = "UNRATE",
observation_start = as.Date("1990-01-01"),
observation_end = as.Date("2000-01-01")
)
```
## Usage
See the [Get started](http://sboysel.github.io/fredr/articles/fredr.html) article.
## Documentation
See the [documentation site](http://sboysel.github.io/fredr/).
## Restrictions
According to the FRED team, the following data sources do not permit redistribution through the FRED API:
- ICE Libor Rates
- ICE Swap Rates
- LBMA Gold Price: Daily Prices
- LBMA Silver Price: Daily Prices
If you need data from any of these sources, it is recommended to download the data directly from the FRED website. The series in these sources can be found [here](https://fred.stlouisfed.org/source?soid=62).
## Code of Conduct
Please note that the fredr project is released with a [Contributor Code of Conduct](http://sboysel.github.io/fredr/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.
## See Also
There are several other existing R packages designed for the FRED API:
* [business-science/tidyquant](https://github.com/business-science/tidyquant)
* [jcizel/FredR](https://github.com/jcizel/FredR)
* [joshuaulrich/quantmod](https://github.com/joshuaulrich/quantmod)
* [quandl/quandl-r](https://github.com/quandl/quandl-r)