nameTofips: County or MSA name to FIPS code(s).

Description Usage Arguments Value Author(s) References Examples

View source: R/nameTofips.R

Description

Takes the name of a county or msa and returns the associated fip(s) codes.

Usage

1
nameTofips(name, state, type = c("county", "msa"), statefips = FALSE)

Arguments

name

a character string, should be either a name of a county or msa.

state

a character string, can either be the full name (e.g. "oregon"), the abbreviation (e.g. "or"), or the FIPS code (e.g. "41")– note that if you are using the FIPS code you have to change statefips to TRUE.

type

a character string, should be either "county" or "msa"

statefips

logical, by default statefips=FALSE, change to TRUE when providing state with a FIPS code.

Value

Returns a character string.

Author(s)

Zack W. Almquist almquist@uci.edu

References

Zack W. Almquist (2010). US Census Spatial and Demographic Data in R: The UScensus2000 Suite of Packages. Journal of Statistical Software, 37(6), 1-31. http://www.jstatsoft.org/v37/i06/.

Census 2000 Summary File 1 [name of state1 or United States]/prepared by the U.S. Census Bureau, 2001.
http://www.census.gov/prod/cen2000/doc/sf1.pdf

Examples

1
2
3
4
5
6
7
8
## Not run: 
## SF MSA FIPS Code
nameTofips("san francisco","ca","msa")

## Orange County FIPS
nameTofips("orange","ca","county")

## End(Not run)

UScensus2000 documentation built on May 2, 2019, 5:13 p.m.