fips_extract: Extract geographic unit codes from FIPS codes.

View source: R/fips_extract.R

fips_extractR Documentation

Extract geographic unit codes from FIPS codes.

Description

This function will split up a column of FIPS codes into several columns, each containing the individual code at different units. It is agnostic to the level of the FIPS codes (i.e., FIPS codes are not required to be 15 digits long). However, this function assumes that all FIPS codes begin at the state level of precision.

Usage

fips_extract(df, fips_col = NULL, geo = NULL)

Arguments

df

The dataframe, with one column containing FIPS codes.

fips_col

A string denoting the column containing the FIPS codes.

geo

A string denoting the smallest geographic unit in the FIPS code. If NULL, the smallest geographic unit is determined based off the length of the FIPS codes.

Value

A dataframe with additional columns containing the individual codes for different geographic units.


eiCompare documentation built on Aug. 31, 2023, 5:16 p.m.