clean.fips1215: Check and clean Census block group or block FIPS - only check...

View source: R/clean.fips1215.R

clean.fips1215R Documentation

Check and clean Census block group or block FIPS - only check number of characters and if NA, not if valid number otherwise

Description

Check if valid Census block group or block FIPS, warn if not, add missing leading zero if inferred.

Usage

clean.fips1215(fips)

Arguments

fips

Vector of one or more elements, ideally character class, ideally 12 or 15 characters long (block group or block), required.

Details

For information on FIPS codes, see http://www.census.gov/geo/reference/ansi.html, and also see https://www.census.gov/geo/reference/geoidentifiers.html

Value

Returns a vector of one or more character elements, same lengths as fips, NA if NA input

See Also

clean.fips()

Examples

  samplefips <- c("011030001003", "011030001003001", 11030001003001, 35, 1, NA, 'invalidtext', '02')
  clean.fips1215(samplefips)
  clean.fips1215("011030001003001")

ejanalysis/ejanalysis documentation built on April 2, 2024, 10:12 a.m.