Learn R Programming

totalcensus (version 0.6.6)

convert_fips_to_names: convert fips codes to names of a geographies

Description

convert fips codes to names of a geographies

Usage

convert_fips_to_names(
  FIPs,
  states = NULL,
  geo_header = "STATE",
  in_states = NULL
)

Arguments

FIPs

string vector of fips code such as c("021", "002")

states

string vector of state abbreviations having same length as FIPs

geo_header

string, taking values of "STATE", "COUNTY", "PLACE", "COUSUB" or "CBSA".

in_states

which states are these FIPs generated from. Use state abbrevations or "US" for national. Vector of unique states.

Value

vector of names corresponding to FIPs and states

Examples

Run this code
# NOT RUN {
aaa <- convert_fips_to_names(c("11", "44"))
# [1] "DC" "RI"

bbb <- convert_fips_to_names(c("001", "013"), states = c("RI", "MA"), geo_header = "COUNTY")
# [1] "Bristol County" "Hampden County"


# }

Run the code above in your browser using DataLab