this function recodes heating fuel types present in survey to oil,gas,electricity,heat_pump,solid_fuel. It also returns primary,secondary and tertiary fuel types present. If these are not present, the fuel type is "none". recode_fuels also imputes the primary heating fuel type if this missing.

recode_fuels(hp_data_in)

Arguments

hp_data_in

input survey data, usually based on hp_survey_oo

Value

recoded dataframe with heating tech columns

Details

solar thermal is set to "none" if it is present. If solar thermal is indicated as the primary fuel in the survey, then the secondary fuel is promoted.

Examples


recode_fuels(hp_survey_oo)
#> # A tibble: 901 × 93
#> # Rowwise: 
#>    serial    qa    qb actualage   qc1   qc2    qe    qf    q1    q2    q3    q4
#>     <dbl> <dbl> <dbl>     <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#>  1     71     1     2        33     5     4     1     8     4     2     4     2
#>  2     72     2     6        68     6     1     7     4     3     2     4     1
#>  3     74     1     2        31     6     1     1     7     2     2     3     2
#>  4     75     1     4        47     6     1     2     7     1     2     3     2
#>  5     76     1     6        65    24     2     6     6     2     2     4     1
#>  6     77     2     1        24     4     3     1     8     4     2     4     2
#>  7     79     2     2        34     3     3     7     5     4     2     3     2
#>  8     81     2     5        64     4     3     7     4     4     1     4     1
#>  9     82     2     4        46     5     4     2     6     4     1     3     2
#> 10     83     2     6        70     6     1     6     3     1     1     2     1
#> # ℹ 891 more rows
#> # ℹ 81 more variables: q5 <dbl>, q6 <dbl>, q7 <dbl>, q81 <dbl>, q82 <dbl>,
#> #   q83 <dbl>, q84 <dbl>, q85 <dbl>, q86 <dbl>, q87 <dbl>, q88 <dbl>,
#> #   q89 <dbl>, q9 <dbl>, q10 <dbl>, q11 <int>, q121 <dbl>, q122 <dbl>,
#> #   q123 <dbl>, q124 <dbl>, q125 <dbl>, q126 <dbl>, q127 <dbl>, q128 <dbl>,
#> #   q129 <dbl>, q13 <dbl>, q13n <dbl>, q14 <dbl>, q14n <dbl>, q15 <dbl>,
#> #   q15n <dbl>, q16 <dbl>, q16n <dbl>, q17 <dbl>, q17n <dbl>, q18 <dbl>, …