recode_state: Recode state abbreviations

Description Usage Arguments See Also Examples

View source: R/prepare.R

Description

This is a convenience function to help standardize odd-looking state abbreviations based on a reference list of allowed abbreviations.

Usage

1
recode_state(dat, state_table, oldvar = "state", newvar = "state_new")

Arguments

dat

data frame: input data with a state variable

state_table

data frame: input data holding valid abbreviations

oldvar

character: name of state variable

newvar

character: name of new state variable

See Also

Other functions for standardizing state license data: recode_month, state_abbreviations

Examples

1
2
3
data(state_abbreviations)
dat <- data.frame(state = c("M0", "mo", "Mo", "MR", "YY"))
recode_state(dat, state_abbreviations)

southwick-associates/salic documentation built on Nov. 5, 2019, 9:13 a.m.