Description Usage Arguments See Also Examples
Recode vehicle type
1 2 3 4 5 6 7 | tc_recode_vehicle_type(
x,
pattern = c(`Taxi*.+` = "Taxi", `Van*.+` = "Van", `Pedal cycle` = "Bicycle",
`(M|m)otorcycle*.+|Elec*.+` = "Motorcycle",
`Data*.+|Other*.+|Agri*.+|Ridden*.+|Mobility*.+|Tram*.+` = "Other", `Bus*.+` = "Bus",
`Minibus*.+` = "Other", `Goods*.+` = "HGV")
)
|
x |
Character string to recode |
pattern |
A named character vector with values representing new values.
Has the form |
tc_recode
1 2 3 4 5 6 7 8 9 | (x = stats19::vehicles_sample$vehicle_type)
tc_recode_vehicle_type(x)
## Not run:
v = stats19::get_stats19(2018, "vehicles")
v$vehicle_type_simple = tc_recode_vehicle_type(v$vehicle_type)
table(v$vehicle_type)
table(v$vehicle_type_simple)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.