Get air quality data for the United Kingdom using the rdefra package

October 6, 2016

(This article was first published on rOpenSci Blog - R, and kindly contributed to R-bloggers)

Whether you are an environmental scientist, a pollution expert or just concerned about the air you breathe when cycling in the United Kingdom, the ropensci rdefra package can help find the information you need. This package gives you access to the UK-AIR database, hosted by the Department for Environment, Food & Rural Affairs in the United Kingdom, directly from R. The database comprises hundreds of air quality monitoring sites and each provides time series of concentration for different pollutants such as ozone, carbon dioxide and nitrogen oxides amongst others. It allows you to efficiently download, plot and compare data for multiple years/stations so that you can easily carry out spatio-temporal analysis or simply plan an healthier route for you bike ride. The package is fully documented and the vignette contains examples for a number of applications, such as how to generate the interactive map of the monitoring stations (see screenshot below).

UK-AIR monitoring stations


The stable version of the package is available from CRAN:


While the development version can be installed from github using devtools:


This package depends on the Geospatial Data Abstraction Library (GDAL) library, which should be previously installed on your machine.

To leave a comment for the author, please follow the link and comment on their blog: rOpenSci Blog - R. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)