get_MSOA_data: Get MSOA energy consumption data

Description Usage Arguments Value Examples

View source: R/msoa.r

Description

This function fetches MSOA (Middle Super Output Area) data from the DECC website. Since the format of these files tends to change just enough to be irritating for dependent code, there is also an option that allows you to cache a local copy.

Usage

1
2
get_MSOA_data(year = max(get_MSOA_years()), sector = c("domestic",
  "nondomestic"), fuel = c("electricity", "gas"), id, dir)

Arguments

year

the year for which you want data. Defaults to the most recent year available.

sector

the economic sector to fetch. Valid values are 'domestic', 'nondomestic'

fuel

the fuel type to fetch. Valid values are 'electricity', 'gas'

id

the unique id of the MSOA to fetch. If not specified, then all MSOAs are retrieved.

dir

an optional directory in which to save a copy of the data

Value

a long data frame with the requested data. The 'energy' column is measured in GWh.

Examples

1
2
3
4
## Not run: 
msoa_data <- get_MSOA_data() # Gets all data

## End(Not run)

jkeirstead/decctools documentation built on May 19, 2019, 11:41 a.m.