pull_spdf: Pull California county SpatialPolygonsDataFrame.

Description Usage Arguments Details Value Source Note Examples

View source: R/03-pull.R

Description

pull_spdf pulls either the section or township-level SpatialPolygonsDataFrame from a county's Geographic Information System (GIS) shapefile.

Usage

1
pull_spdf(county, section_township = "section", quiet = FALSE)

Arguments

county

A character string giving either a county name, two digit PUR county code, or six-digit FIPS county code. 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.

section_township

Either "section" (the default) or "township". Specifies whether you would like to pull a section- or township-level SpatialPolygonsDataFrame.

quiet

TRUE / FALSE indicating whether you would like a message and progress bar printed for the shapefile that is downloaded. The default value is FALSE.

Details

SpatialPolygonsDataFrame objects are pulled by county from the CDPR's FTP server. Downloaded SpatialPolygonsDataFrame objects are saved in a temporary environment, which is deleted at the end of the current R session.

Value

A SpatialPolygonsDataFrame object.

Source

SpatialPolygonDataFrame objects are downloaded from GIS shapefiles provided by the California Department of Pesticide Regulation: http://www.cdpr.ca.gov/docs/emon/grndwtr/gis_shapefiles.htm

Note

If this function returns an error (because the FTP site is down, for example), check your working directory. You may want to change it back from a temporary directory.

Examples

1
2
3
4
fresno_shp <- pull_spdf("fresno")
fresno_shp 
del_norte_shp <- pull_spdf("08", "township")
del_norte_shp 

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