Learn R Programming

countyfloods (version 0.0.2)

get_county_cd: Get all FIPS county codes within a state

Description

This function will return all county FIPS codes for all counties within a state or states.

Usage

get_county_cd(state)

Arguments

state

Character vector giving the name of state or states (not case sensitive) for which you would like to get county FIPS codes.

Value

A character vector with the 5-digit FIPS codes for all counties within the specified state or states.

Details

This function uses the county.fips dataset from the maps package to pull county FIPS for a state.

Examples

Run this code
# NOT RUN {
 get_county_cd("Virginia")
 get_county_cd(c("North Carolina", "South Carolina"))

# }

Run the code above in your browser using DataLab