generateGrid: Generates a grid in a given local CRS that is, by default,...

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/generateGrid.R

Description

Implementation of a simple grid generation function that can be used to produce target SpatialPolygonDataFrames to be used in geomerge.

Usage

1
generateGrid(extent, size, local.CRS, makeWGS84 = TRUE, silent = FALSE)

Arguments

extent

SpatialPolygonsDataFrame that defines the (minimum) extent of the grid to be generated.

size

size of the grid cells in m.

local.CRS

definition of the local (projected) CRS the grid is spanned in. Has to be class "CRS".

makeWGS84

Boolean switch indicating whether or not the grid is returned in WGS84. Default = TRUE.

silent

Boolean switch to suppress any (non-critical) warnings and messages. Default = FALSE.

Value

Returns an object of SpatialPolygonsDataFrame that spans the grid with spatial resolution given by size.

Author(s)

Karsten Donnay and Andrew M. Linke.

References

Andrew M. Linke, Karsten Donnay. (2017). "Scale Variability Misclassification: The Impact of Spatial Resolution on Effect Estimates in the Geographic Analysis of Foreign Aid and Conflict." Paper presented at the International Studies Association Annual Meeting, February 22-25 2017, Baltimore.

See Also

geomerge-package, geomerge

Examples

1
2
3
4
5
6
require(sp)
data(geomerge)

# Generate grid with 10 km cell size in local CRS for Nigeria
counties.grid <- generateGrid(counties,10000,local.CRS=CRS("+init=epsg:26391"),
                              silent=TRUE)

geomerge documentation built on Aug. 29, 2017, 1:02 a.m.