13 External data sources
13.1 Office of National Statistics
For this example we’re going to get the population for each Ward in Sheffield. First we need to find the dataset on the ONS website. From which we copy the link to the Excel file and use it in the script below:
The monstR and onsr R packages provide access to the ONS beta API. However, the API currently has a limited number of datasets, and in particular it lacks access to the data for smaller geographies that we’re typically interested in e.g. wards and LSOAs.
13.2 Ministry of Housing, Communities & Local Government
Official statistics from MHCLG (Ministry of Housing, Communities & Local Government):
opendatacommunities.org
guides.opendatacommunities.org/article/19-apis-part-2-using-r-with-the-apis