find_counties: Find California county codes or names.

Description Usage Arguments Value Examples

View source: R/02-find.R

Description

Given a vector of counties, find_counties returns either PUR county codes or names.

Usage

1
find_counties(counties, return = "pur_codes")

Arguments

counties

A vector of character strings giving either a county names, two digit PUR county codes, or six-digit FIPS county codes. Not case sensitive. California names and county codes as they appear in PUR data sets can be found in the county_codes data set available with this package.

return

Either "pur_codes" to return PUR county codes (the default), "fips_codes" to return FIPS county codes, or "names" to return county names.

Value

If return = "pur_codes", a vector of two-character strings giving the corresponding PUR county codes. If return = "fips_codes", a vector of six-digit character strings giving the corresponding FIPS county codes. If return = "names", a vector of county names.

Examples

1
2
3
find_counties(c("01", "06005", "el dorado"))
find_counties(c("01", "06005", "el dorado"), return = "fips_codes")
find_counties(c("01", "06005", "el dorado"), return = "names")

leighseverson/purexposure documentation built on Aug. 13, 2021, 6:34 p.m.