Skip to contents

Uses us_location_lookup() to perform recoding.

Usage

us_location_recode(location, location_input_format, location_output_format)

Arguments

location

vector of location values

location_input_format

format in which the location vector is coded. See to_us_location_table_column() for permitted formats. Must be a single value.

location_output_format

Code the output vector in this format. See to_us_location_table_column() for permitted formats. Must be a single value.

Value

The recoded vector.

Examples


us_location_recode(c("01", "05", "US", "05"), "code", "name")
#> [1] "Alabama"       "Arkansas"      "United States" "Arkansas"     

us_location_recode(c("AK", "US", "HI", "AK"), "abbr", "code")
#> [1] "02" "US" "15" "02"

us_location_recode("AK", "abbr", "name")
#> [1] "Alaska"