create_PDS: Load PDS data from csvs, clean, format, and quantify

Description Usage Arguments Value Examples

Description

This utility function is used to create a cleaned dataset ready for use with the Blockbuster2 Deterioration Model.

Usage

1
2
3
4
5
6
7
8
create_PDS(single_table = FALSE, remove_elements = FALSE,
  add_rates = FALSE, add_costs = FALSE, widen = TRUE,
  establishment_path = "./PDS/PDS_full_establishment.csv",
  establishment_sep = "\t", building_path = "./PDS/PDS_full_building.csv",
  building_sep = ",", condition_path = "./PDS/PDS_full_condition.csv",
  condition_sep = "\t", repair_costs = "./data_ext/parameter.table.rda",
  deterioration_rates = "./data_ext/deterioration.rates.rda",
  elementid = c(1810, 1952, 1838, 1845, 1869, 1891, 1918, 1992, 1994))

Arguments

single_table

logical. If TRUE, the output will be a single component-level table

remove_elements

logical. If TRUE, the elements specified in the elementid argument will be removed.

add_rates

logical. If TRUE, the deterioration rates will be included in the output.

add_costs

logical. If TRUE, the repair costs will be included in the output.

establishment_path

character. Path to the establishment level data.

establishment_sep

character. String used as column divider by the csv holding establishment data

building_path

character. Path to the building level data

building_sep

character. String used as column divider by the csv holding building level data

condition_path

character. Path to the component level data

condition_sep

character. String used as column divider by the csv holding component level data

deterioration_rates

Either a character string contain the path to a dataframe, or a dataframe containing elementid, ab, bc, cd and de columns that specify the deterioration rates for each element type.

elementid

A numeric vector containing the ElementID numbers of the components you wish to remove. By default this contains the elementIDs of unpainted redecorations and components that do not exist, e.g. no ceiling.

Value

The default behaviours is to produce a list of three tables (school-level, building-level and component-level) containing all elements from the PDS data, with columns containing the unit_area and probability of being at each grade (which will be one or zero).

Setting single_table = TRUE will produce a single component-level table.

Setting remove_elements will remove those components specified by elementid in the elementid argument. This is intended to remove those 'empty' components which indicate there is nothing there, for instance unpainted decorations, or no heating. By default these are the elements specified by the elementid argument default.

The arguments add_rates and add_costs will cause the deterioration rates and repair costs to be added to component-level output as columns if there are set to TRUE/

The widen argument will add a column for each grade to the component-level output. These columns contain the proability that the component is at that grade and will be one or zero.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
create_PDS()

# include repair costs and deterioration rates
create_PDS(add_rates = TRUE, add_costs = TRUE)

# remove 'empty' elements
create_PDS(remove_elements = TRUE)

# create a single table suitable for passing to the Blockbuster2 Deterioration Model using all default parameters and settings
input <- create_PDS(single_table = TRUE, remove_elements = TRUE, add_rates = TRUE, add_costs = TRUE)
Blockbuster2::Blockbuster(input)

## End(Not run)

DFE-Capital/Blockbuster2DataPrep documentation built on May 12, 2019, 5:41 a.m.