Skip to contents

Ensures FIPS has the leading zero, but does NOT VALIDATE FIPS - It does NOT check if FIPS is valid other than checking its length. fips could be a state, county, tract, blockgroup, or block FIPS code.

Usage

fips_lead_zero(fips)

Arguments

fips

vector of numeric or character US FIPS codes

Value

vector of same length

Examples

testfips1 <- c(1,"01",1234,"1234","12345",123456)
testfips <- c(1, "1", "12", "123", "1234", "12345", "", NA, "words")
fips_lead_zero(testfips1)
fips_lead_zero(testfips)