recodes the input survey data for use in initialise_agents. The recoded features are BER, ground floor area, and gross household income.

recode_survey(hp_data_in)

Arguments

hp_data_in

input survey e.g. hp_survey_oo

Value

dataframe

Details

Note that this function is based on the actual survey date, taken as 2024.5

Examples


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