Skip to contents

Download shapefiles based on FIPS codes of States, Counties, Cities/CDPs, Tracts, or Blockgroups

Usage

shapes_from_fips(fips)

Arguments

fips

vector of one or more Census FIPS codes such as from name2fips()

Value

spatial data.frame with one row per fips (assuming any fips are valid)

Examples

 fipslist = list(
  statefips = name2fips(c('DE', 'RI')),
  countyfips = fips_counties_from_state_abbrev(c('DE')),
  cityfips = name2fips(c('chelsea,MA', 'st. john the baptist parish, LA')),
  tractfips = substr(blockgroupstats$bgfips[300:301], 1, 12),
  bgfips = blockgroupstats$bgfips[300:301]
  )
  shp <- list()
  if (FALSE) { # \dontrun{
   for (i in seq_along(fipslist)) {
    shp[[i]] <- shapes_from_fips(fipslist[[i]])
    print(shp[[i]])
    # mapfast(shp[[i]])
   }
  } # }