statswalesr is a package for downloading datasets and their associated metadata from StatsWales. This functionality is limited to datasets that are available through the OData feed. You can check this by navigating to your desired dataset, scrolling to the bottom, and checking that the “Dataset” link is available under the Open Data tab.
statswalesr is now on CRAN. To install:
You can install the development version of statswalesr from GitHub with:
The code below extracts data about aircraft movement at Cardiff airport and the associated metadata.
library(statswalesr)
metadata <- statswales_get_metadata("tran0003")
df <- statswales_get_dataset("tran0003")
You can also search for datasets based on key terms. For example, to search for datasets related to farming and agriculture:
## Rows: 29
## Columns: 2
## $ Description_ENG <chr> "Children's services: Welfare/health summary", "Childr~
## $ Dataset <chr> "care0021", "care0022", "agri0200", "agri0201", "agri0~
All statswalesr functions support Welsh language downloads using the language argument: