Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (17.4%) to scientific vocabulary
Last synced: 10 months ago
·
JSON representation
Repository
RBA data, but tidy
Basic Info
- Host: GitHub
- Owner: MattCowgill
- License: other
- Language: R
- Default Branch: master
- Homepage: https://mattcowgill.github.io/readrba/index.html
- Size: 20.4 MB
Statistics
- Stars: 28
- Watchers: 4
- Forks: 3
- Open Issues: 1
- Releases: 4
Created almost 6 years ago
· Last pushed 12 months ago
Metadata Files
Readme
Changelog
License
README.Rmd
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
# out.width = "100%",
fig.height = 5,
fig.width = 7,
fig.retina = 2
)
```
# readrba
[](https://github.com/MattCowgill/readrba/actions) [](https://lifecycle.r-lib.org/articles/stages.html) [](https://app.codecov.io/gh/MattCowgill/readrba?branch=master)
[](https://CRAN.R-project.org/package=readrba)
[](https://github.com/MattCowgill/readrba/actions/workflows/R-CMD-check.yaml)
Get data from the [Reserve Bank of Australia](https://rba.gov.au/statistics/tables/) in a [tidy](https://tidyr.tidyverse.org/articles/tidy-data.html) [tibble](https://tibble.tidyverse.org).
## Installation
Install from CRAN using:
```{r eval=FALSE}
install.packages("readrba")
```
Or install the development version from GitHub:
```{r eval=FALSE}
remotes::install_github("mattcowgill/readrba")
```
## Examples
```{r library, message = FALSE}
library(ggplot2)
library(dplyr)
library(readrba)
```
### Quick examples
With just a few lines of code, you can get a data series from the RBA and visualise it!
Here's the unemployment rate:
```{r}
unemp_rate <- read_rba(series_id = "GLFSURSA")
unemp_rate %>%
ggplot(aes(x = date, y = value)) +
geom_line() +
theme_minimal() +
labs(title = "Unemployment rate (actual)")
```
And you can also easily get the RBA's public forecasts - from 1990 to present -
and visualise those. Here's every public forecast of the unemployment rate the
RBA has made over the past three decades:
```{r}
unemp_forecasts <- rba_forecasts() %>%
filter(series == "unemp_rate")
unemp_forecasts %>%
ggplot(aes(x = date,
y = value,
group = forecast_date,
col = forecast_date)) +
geom_line() +
theme_minimal() +
labs(title = "Unemployment rate (RBA forecasts)")
```
### Reading RBA data
There primary function in {readrba} is `read_rba()`.
Here's how you fetch the current version of a single RBA statistical table: table G1, consumer price inflation using `read_rba()`:
```{r}
cpi_table <- read_rba(table_no = "g1")
```
The object returned by `read_rba()` is a tidy tibble (ie. in 'long' format):
```{r}
head(cpi_table)
```
You can also request multiple tables. They'll be returned together as one tidy tibble:
```{r}
rba_data <- read_rba(table_no = c("a1", "g1"))
head(rba_data)
unique(rba_data$table_title)
```
You can also retrieve data based on the unique RBA time series identifier(s). For example, to getch the consumer price index series only:
```{r}
cpi_series <- read_rba(series_id = "GCPIAG")
head(cpi_series)
unique(cpi_series$series_id)
```
The convenience function `read_rba_seriesid()` is a wrapper around `read_rba()`. This means `read_rba_seriesid("GCPIAG")` is equivalent to `read_rba(series_id = "GCPIAG")`.
By default, `read_rba()` fetches the current version of whatever table you request. You can specify the historical version of a table, if it's available, using the `cur_hist` argument:
```{r hist}
hist_a11 <- read_rba(table_no = "a1.1", cur_hist = "historical")
head(hist_a11)
```
### Browsing RBA data
Two functions are provided to help you find the table number or series ID you need. These are `browse_rba_tables()` and `browse_rba_series()`. Each returns a tibble with information about the available RBA data.
```{r browse}
browse_rba_tables()
```
```{r browse_series}
browse_rba_series()
```
You can specify a search string to filter the tables or series, as in:
```{r browse-search}
browse_rba_tables("inflation")
```
### RBA forecasts
The function `rba_forecasts()` provides easy access to all the RBA's public
forecasts of key economic variables since 1990. The function scrapes the
RBA website to obtain the latest Statement on Monetary Policy forecasts.
```{r forecasts}
rba_forecasts()
```
If you just want the latest forecasts, you can request them:
```{r latest-forecasts}
rba_forecasts(all_or_latest = "latest")
```
## Data availability
The `read_rba()` function is able to import most tables on the [Statistical Tables](https://rba.gov.au/statistics/tables/) page of the RBA website. These are the tables that are downloaded when you use `read_rba(cur_hist = "current")`, the default.
`read_rba()` can also download many of the tables on the [Historical Data](https://rba.gov.au/statistics/historical-data.html) page of the RBA website. To get these, specify `cur_hist = "historical"` in `read_rba()`.
### Historical exchange rate tables
The historical exchange rate tables do not have table numbers on the RBA website. They can still be downloaded, using the following table numbers:
```{r echo=FALSE}
ex_rates <- dplyr::filter(readrba:::table_list, grepl("ex", no))
ex_rates <- dplyr::select(ex_rates, `Table title` = title, `table_no` = no)
knitr::kable(ex_rates)
```
### Non-standard tables
`read_rba()` is currently only able to import RBA statistical tables that are formatted in a (more or less) standard way. Some are formatted in a non-standard way, either because they're distributions rather than time series, or because they're particularly old.
Tables that are **not** able to be downloaded are:
```{r echo=FALSE}
nonreadable <- dplyr::filter(readrba:::table_list, readable == FALSE)
nonreadable <- dplyr::select(nonreadable, `Table title` = title, table_no = no, current_or_historical)
knitr::kable(nonreadable )
```
## Resolving network issues by manually setting the download method
Certain corporate networks restrict your ability to download files in an R session. On some of these networks, the `"wininet"` method must be used when downloading files. Users can specify the method that will be used to download files by setting the `"R_READRBA_DL_METHOD"` environment variable.
For example, the following code sets the environment variable for your current session:
```{r, eval = FALSE}
Sys.setenv("R_READRBA_DL_METHOD" = "wininet")
```
You can add `"R_READRBA_DL_METHOD"` to your .Rprofile to have this persist across sessions.
If you have other issues using `{readrba}` in your corporate environment, I would appreciate you opening an issue on GitHub.
## Issues and contributions
I welcome any feature requests or bug reports. The best way is to file a [GitHub issue](https://github.com/MattCowgill/readrba/issues).
I would welcome contributions to the package. Please start by filing an issue, outlining the bug you intend to fix or functionality you intend to add or modify.
## Disclaimer
This package is not affiliated with or endorsed by the Reserve Bank of Australia. All data is provided subject to any conditions and restrictions set out on the RBA website.
Owner
- Name: Matt Cowgill
- Login: MattCowgill
- Kind: user
- Location: Melbourne
- Website: mattcowgill.com
- Twitter: mattcowgill
- Repositories: 8
- Profile: https://github.com/MattCowgill
GitHub Events
Total
- Watch event: 1
- Push event: 6
- Pull request event: 2
- Fork event: 1
- Create event: 2
Last Year
- Watch event: 1
- Push event: 6
- Pull request event: 2
- Fork event: 1
- Create event: 2
Committers
Last synced: about 1 year ago
Top Committers
| Name | Commits | |
|---|---|---|
| Matt Cowgill | m****l@g****m | 187 |
| “Matt | “****l@g****” | 3 |
| Angus Moore | 1****e | 2 |
| Matt Cowgill | m****l@M****l | 2 |
| Ben Jackman | 5****n | 1 |
Committer Domains (Top 20 + Academic)
gmail.com”: 1
Issues and Pull Requests
Last synced: 11 months ago
All Time
- Total issues: 33
- Total pull requests: 30
- Average time to close issues: about 1 month
- Average time to close pull requests: 3 days
- Total issue authors: 8
- Total pull request authors: 3
- Average comments per issue: 1.97
- Average comments per pull request: 0.2
- Merged pull requests: 30
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 2
- Pull requests: 4
- Average time to close issues: 9 days
- Average time to close pull requests: 2 days
- Issue authors: 2
- Pull request authors: 1
- Average comments per issue: 3.5
- Average comments per pull request: 0.0
- Merged pull requests: 4
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- MattCowgill (24)
- nerdcha (3)
- tiprya (1)
- chrisschwartz-10 (1)
- donotdespair (1)
- doubleunplussed (1)
- benjackman (1)
- ZacTSYWA (1)
Pull Request Authors
- MattCowgill (36)
- benjackman (2)
- angusmoore (1)
Top Labels
Issue Labels
work-in-progress (1)
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 1,062 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 12
- Total maintainers: 1
cran.r-project.org: readrba
Download and Tidy Data from the Reserve Bank of Australia
- Homepage: https://mattcowgill.github.io/readrba/index.html
- Documentation: http://cran.r-project.org/web/packages/readrba/readrba.pdf
- License: MIT + file LICENSE
-
Latest release: 0.1.12
published 11 months ago
Rankings
Stargazers count: 11.6%
Forks count: 17.8%
Average: 25.1%
Dependent packages count: 29.8%
Downloads: 31.0%
Dependent repos count: 35.5%
Maintainers (1)
Last synced:
11 months ago
Dependencies
DESCRIPTION
cran
- R >= 3.6.0 depends
- dplyr >= 1.0.0 imports
- httr * imports
- lubridate * imports
- purrr * imports
- readxl >= 1.3.0 imports
- rlang * imports
- rvest >= 0.3.6 imports
- stringr * imports
- tidyr >= 1.0.0 imports
- xml2 * imports
- covr * suggests
- ggplot2 * suggests
- knitr * suggests
- markdown * suggests
- rmarkdown * suggests
- testthat * suggests
.github/workflows/R-CMD-check-cron.yaml
actions
- actions/checkout v2 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/R-CMD-check.yaml
actions
- actions/cache v2 composite
- actions/checkout v2 composite
- actions/upload-artifact main composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
.github/workflows/covr.yaml
actions
- actions/cache v2 composite
- actions/checkout v2 composite
- r-lib/actions/setup-pandoc v1 composite
- r-lib/actions/setup-r v1 composite
.github/workflows/pkgdown.yaml
actions
- actions/cache v2 composite
- actions/checkout v2 composite
- r-lib/actions/setup-pandoc v1 composite
- r-lib/actions/setup-r v1 composite