fct_statefips: Convert a state FIPS code to a labeled factor

View source: R/statefips.R

fct_statefipsR Documentation

Convert a state FIPS code to a labeled factor

Description

Convert a state FIPS code to a labeled factor

Usage

fct_statefips(x, labels = c("name", "abbrv"))

Arguments

x

Vector of state FIPS codes. If x is a character vector, it will first be coerced to numeric.

labels

A character string specifying how to label the levels: "name" for state names (the default), or "abbrv" for state postal abbreviations.

Value

x as a labeled factor

See Also

state_fips for a dataset containing state FIPS codes, state names, and postal abbreviations.

Examples

fips <- c(1, 6, 11, 48)
fct_statefips(fips)
fct_statefips(fips, labels = "abbrv")


CenterOnBudget/Rcbpp documentation built on Jan. 6, 2025, 9:32 p.m.