get_LAD_data: Get LAD energy consumption data

Description Usage Arguments Value Examples

View source: R/lad.r

Description

Gets LAD (Local Administrative District) energy data from the DECC website, http://www.decc.gov.uk. 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. Note that the total values do not contain the unallocated fuel values, which represent approximately 0.3 demand.

Usage

1
2
get_LAD_data(year = max(get_LAD_years()), sector = "total",
  fuel = "total", id, dir)

Arguments

year

the year to fetch. If not specified, then the most recent year is retrieved. Only single years currently supported

sector

a vector of economic sectors to fetch. Valid values are 'domestic', 'industrial', 'transport', 'total', 'all'. Default = 'total'

fuel

a vector of fuel types to fetch. Valid values are 'coal', 'manufactured', 'petrol', 'gas', 'electricity', 'bioenergy', 'total', 'all'. Default = 'total'. 'All' includes the total as well.

id

the unique id of the LAD to fetch. If not specified, then all LADs are retrieved. ##'

dir

an optional directory in which to cache the data

Value

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
# Gets energy data for total fuels and sectors for most recent year
lad_data <- get_LAD_data()

## End(Not run)

## Not run: 

# Gets energy data for electricity and gas use in the domestic
sector in the most recent year # Depending on the status of DECC
servers, this can sometimes fail.  In which case, an empty # data
frame is returned.

df <- get_LAD_data(sector="domestic", fuel=c("electricity",
"gas"))


## End(Not run)

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