tc_recode_casualties: Recode casualty_type variable from STATS19 data

Description Usage Arguments Examples

View source: R/tc_recode.R

Description

Recode casualty_type variable from STATS19 data

Usage

1

Arguments

x

Character string to recode

pattern

A named character vector with values representing new values. Has the form c("Car long name" = "Car", "Taxi/Private hire car" = "Taxi"). Car long name will be converted into Car in this case.

pattern_match

Character string in the form of c("car" = "car", "bike" = "bike") that replaces all parts of the match.

Examples

1
2
3
4
5
6
7
8
9
(x = stats19::casualties_sample$casualty_type)
tc_recode_casualties(x)
## Not run: 
cas = stats19::get_stats19(2018, "casualties")
cas$casualty_type_simple = tc_recode_casualties(cas$casualty_type)
table(cas$casualty_type)
table(cas$casualty_type_simple)

## End(Not run)

saferactive/traffiCalmr documentation built on Nov. 18, 2021, 5:06 a.m.