decctools is an R package that provides easy access to energy statistics from the United Kingdom Department of Energy and Climate Change. It currently provides access to two major data sources:

You must have either Curl or Wget installed to use this package.

Sub-national statistics

To access sub-national statistics, you will need to use one of three methods:

For all of these methods, see ?methodname for options to select demands for only certain zones, sectors, or fuel types. Note that not all geographies provide the same level of data; for example at the LSOA level, data are only available for domestic electricity and gas in England and Wales.

Here's an example:

## Gets energy data for electricity and gas use in the domestic sector in the most recent year
df <- get_LAD_data(sector="domestic", fuel=c("electricity", "gas"))

Grid carbon intensity

Elexon's BM Reports provides data on the UK's electricity market including the amount of electricity generated by different fuel types in each half-hourly period of the day. Historic data (back to 2009-01-01) has been archived by the charity Renewable Energy Foundation and decctools uses their summaries to provide the data used here.

There are two methods of interest:

An example:

get_grid_carbon('2013-05-01', '2013-05-31')