prevR (version 3.4.0)

as.SpatialGrid,prevR-method: Create a spatial grid from an object of class prevR.

Description

This function generates a spatial rectangular grid from the slot boundary of an object of class prevR; function used in particular by the methods kde, krige and idw.

Usage

# S4 method for prevR
as.SpatialGrid(object, nb.cells = 100,
  cell.size = NULL)

Arguments

object

object of class prevR.

nb.cells

number of cells on the longuest side of the studied area (unused if cell.size is defined).

cell.size

size of each cell (in the unit of the projection).

Value

Object of class SpatialGrid{sp}.

Details

This function generates a spatial rectangular grid, each cell being a square of side cell.size. If cell.size is not defined, side of cells will be calculated as the longuest side of the slot boundary of object divided by nb.cells.

See Also

GridTopology{sp}, SpatialGrid-class{sp}.

Examples

Run this code
# NOT RUN {
str(as.SpatialGrid(fdhs))
str(as.SpatialGrid(fdhs, nb.cells=200))

# }

Run the code above in your browser using DataCamp Workspace