Description Usage Arguments Author(s) Examples
This function downloads Census county data and links each county to grid cells. The linking is area weighted to each grid.
1 2 3 4 |
method |
Method to map counties and grids. ‘Overlap’ (default) calculate the overlap in the area of each spacial polygon. ‘Points’ approximates the calculation by generating random points in each county and linking those to the nearest grid centroid. Points is more robust to invalid spatial polygons and irregularly spaced grid. |
lon |
A numeric vector of numeric longitudes for the centroids of each gridcell |
lat |
A numeric vector of numeric lattitudes for the centroids of each gridcell |
drop.states |
A character vector of two letter state abreviations to be dropped from the analysis. |
keep.states |
A list of states to keep. |
path |
A path to store data. |
res |
Resolution of the county files. The choices are ‘500k’ (default), ‘5m,’ and ‘20m’ which translate to 500k = 1:500,000, 5m = 1:5,000,000, and 20m = 1:20,000,000. This controls how precise the counties are defined. |
year |
The year of the county file. Default is 2010. They are available for each decenial census and 2013. |
proj4string |
A CRS class. |
grid.tolerace |
Grid tolerance used to make sure sure the grid is evenly spaced. Default is 10^10. For overlap method only. |
n.points |
Number of points generated in each county for points method. The large the number the more precise but slower it will be |
dataframe |
A logical with TRUE indicating to return a dataframe of shapes and FALSE (default) indicating to return an object of class SpatialPolygons |
Ander Wilson
1 2 3 4 | data(GridToMapSampleData)
lon <- GridToMapSampleData$names$lon
lat <- GridToMapSampleData$names$lat
ma.overlap<- GridToMap(lon=lon, lat=lat, method="overlap",keep.states=c("MA"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.