addFIPScomponents: Add col for each component of longer FIPS

View source: R/addFIPScomponents.R

addFIPScomponentsR Documentation

Add col for each component of longer FIPS

Description

Given a data.frame with FIPS col that is the full state county tract blockgroup FIPS returns the data.frame with extra columns up front, with components of FIPS.

Usage

addFIPScomponents(bg, fipscolname = "FIPS", clean = TRUE)

Arguments

bg

Data.frame with a character column called FIPS (or specified otherwise)

fipscolname

FIPS by default but could specify some other name to be found as col in bg

clean

Does not use clean.fips() if FALSE, which helps if the countiesall or other list is not yet updated, for example and lacks some new FIPS code

Value

Returns the whole data.frame with new columns in front: 'FIPS', 'FIPS.TRACT', 'FIPS.COUNTY', 'FIPS.ST', 'ST', 'statename', 'REGION'


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