-
Notifications
You must be signed in to change notification settings - Fork 1
Stock Subsets
subset -> conditioned, according to assumptions, requirements, needs
According to the purpose of the study, a selection of elements can be performed. This makes possible to perform an analysis in three different ways:
- stock evaluation : considering all the elements of the dataset
- group study : selecting a subset of the dataset; for example for policy testing
- single element : for studying an specific or general case
For this however, a degree of knowledge regarding the dwelling archetypes found in the sources of information is required.
The variable var.funListAim
contains the possible options to perform the subset by variables or conditions.
lst.EnHub.TypologyConfigurations
names(lst.EnHub.TypologyConfigurations)
The function fnCombineEHSs()
combines the loaded EHS datasets. This is convenient to look at the whole survey data in one go, but is not very efficient to be used iteratively.
tbl.EHS.subset.der <- fnCombineEHSs()
In this example, a number of variables are chosen to create a subset. These can be initially displayed by reading the lists, and later the chosen variables can be requested with subset
.
lst.EnHub.InputVariables[1:9]
lst.EnHub.InputVariables[10]
names(lst.EnHub.InputVariables)
tbl.EHS.subset.der <- subset(fnCombineEHSs(),
V534_TFAsurvey > 200 &
D001_DwellingAge < 6 &
D003_Region == 'Yorkshire and the Humber' &
D004_TenureType == 'private owner occupied' &
V542_FloorPosition == 'House/Bungalow')
In this example, a range of heating system configurations are selected (e.g. electrical systems).
tbl.EHS.subset.der <- subset(fnCombineEHSs(),
D082_MainHeatingSystemType >= 6 &
D082_MainHeatingSystemType <= 8 &
D097_DHWSystemType != 8)
An alternative, and perhaps explicit, method to crate the subset uses the dplyr::filter
function, directly piped from the dataset. In this example, one of the additional EHS
variables is employed for the selection.
tbl.EHS.subset.der <-
fnCombineEHSs() %>% filter(.hubtyp == 'terraced',
.hubage == 'industrial',
V573_Urbanity == 'Village centre',
V534_TFAsurvey < 105)
questions, issues and request --> EnHub-UK