a character string, takes a four digit MSA FIPS code (e.g. "0040" of Texas)
msaname
a character string, this can either be in conjunction with the variable state or not. Case 1: Full MSA name (state should be left NULL in this case) (e.g. "Abilene, TX MSA"); this must be exact. Case 2: takes one of the city names of the MSA and the one of the states which contain the MSA (e.g. msaname="Albany" and state= "NY").
state
a character string, this takes in a state abbreviation in capitals in conjunction with msaname, see above for more details.
statefips
logical, by default statefips=FALSE, change to TRUE when providing state with a FIPS code.
level
a character string, takes in one of three values: "tract", "blk", or "blkgrp". This defines the geographic level of data for the MSA.
proj
CRS-class, takes a CRS object (e.g. CRS("+proj=utm +zone=10 +datum=NAD83") ); This is simply a wrapper for the spTransform function in rgdal . WARNING requires rgdal package.
Value
An object of class SpatialPolygonsDataFrame.
Warning
You must have the packages UScensus2000blkgrp and UScensus2000blk installed to use levels "blkgrp" and "blk" respectively.
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/.
## Not run:
## Load the data files for MSA names and MSA FIPS codes
data(MSAnames)
data(MSAfips)
## Save the FIPS code for Abilene, TX MSA
ab.fips<-MSAfips$msa.cmsa.fips[1]
###Use the MSA FIPS code
Abilene<-MSA(msafips=ab.fips,level="tract")
###USe the MSA full name
Abilene<-MSA(msaname="Abilene, TX MSA",level="tract")
##Use the msaname alternative
portland<-MSA(msaname="Portland",state="OR",level="tract")
##Plot Portland
plot(portland)
title("Portland MSA, OR 2000")
## End(Not run)