Skip to contents

Just read the codes in one column of a table obtained from something like read.csv, or excel, etc.

Usage

fips_from_table(fips_table, addleadzeroes = TRUE, inshiny = FALSE)

Arguments

fips_table

data.frame or data.table of FIPS codes for counties, states, or tracts, for example, in a column whose name can be interpreted as FIPS (is one of the aliases like fips, countyfips, etc.) Aliases are: c("FIPS", "fips", "fips_code", "fipscode", "Fips", "statefips", "countyfips", "ST_FIPS", "st_fips", "ST_FIPS", "st_fips", "FIPS.ST", "FIPS.COUNTY", "FIPS.TRACT")

addleadzeroes

whether to add leading zeroes where needed as for a State whose FIPS starts with "01"

inshiny

used by server during shiny app

Value

vector of fips codes

Examples

 fips_from_table( data.frame(countyfips=0, FIPS=1, bgfips=2, other=3, fips=4))