The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.
The R package readapra
provides a series of function to
download and import data from the Australian Prudential Regulation
Authority’s (APRA) statistical publications and return them as a tibble object.
You can install readapra
from CRAN using:
install.packages("readapra")
Or you can install the development version from GitHub using the remotes
package:
::install_github("javanderwal/readapra") remotes
The readapra
package facilitates the downloading and
importing of statistical publications published by APRA. The package
also allows for the importing of data from locally saved statistical
publication files.
Currently the readapra
package only supports the
downloading and importing of Authorised Deposit-taking Institution (ADI)
statistical publications. The intention is for future versions of
readapra
to also accommodate APRA’s general insurance, life
insurance and friendly societies, private health insurance and
superannuation statistical publications.
The following ADI statistical publications can be downloaded and
imported with readapra
:
Quarterly Authorised Deposit-taking Institution Performance Statistics (QADIPS)
Quarterly Authorised Deposit-taking Institution Centralised Publication (QADICP)
Quarterly Authorised Deposit-taking Institution Property Exposures Statistics (QADIPEXS) (both the current and historic series)
Monthly Authorised Deposit- taking Institution Statistics (MADIS) (both the current and historic series)
Authorised Deposit-taking Institution Points of Presence Statistics (ADIPOPS)
The ability to download and import APRA’s statistical publications
with readapra
greatly eases the analysis and visualisation
of this data via packages such as ggplot2
.
The following example demonstrates the plotting of total resident assets on a monthly basis for Australia’s four major banks.
We start by first librarying the required packages:
library(readapra)
library(dplyr)
library(ggplot2)
We then download and import the Monthly Authorised Deposit-taking
Institution Statistics (MADIS) data using the read_apra()
function:
<- read_apra(stat_pub = "madis", cur_hist = "current") madis_data
We then filter the desired data like so:
<-
major_bank_assets %>%
madis_data filter(
%in% c(48123123124, 33007457141, 12004044937, 11005357522),
abn == "Total residents assets"
series )
And then finally we can plot the data using ggplot2
:
ggplot(
data = major_bank_assets,
mapping = aes(date, value, colour = institution_name)
+
) geom_line() +
theme_classic() +
theme(legend.position = "bottom") +
guides(colour = guide_legend(ncol = 1))
Corporate networks, especially those using Virtual Private Networks
(VPNs), may restrict the ability to download files within an R session.
A possible fix for this is to utilise the the "wininet"
method for downloading files. Users can specify the
"wininet"
method (or any other download method) for
readapra
to use by setting the
"R_READAPRA_DL_METHOD"
environment variable.
To set the "R_READAPRA_DL_METHOD"
environment variable
to "wininet"
for your current session, use the following
code:
Sys.setenv("R_READAPRA_DL_METHOD" = "wininet")
You can add "R_READAPRA_DL_METHOD" = "wininet"
to your
.Renviron
file to ensure this download setting persists
across R sessions. You can conveniently access and edit your
.Renviron
file with the usethis
package:
::edit_r_environ() usethis
This package is not affiliated with or endorsed by the Australian Prudential Regulation Authority (APRA). All data is provided subject to any conditions and restrictions set out on the APRA website.
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.