Learn R Programming

secr (version 4.6.9)

gridCells: Construct Grid Cells

Description

Forms grid cells centred on input points.

Usage

gridCells(x, cellsize = spacing(x), crs = NA)

Value

A simple features (sf) object of class `sfc_MULTIPOLYGON'.

crs may be the integer EPSG code (e.g. 3578 Yukon Albers).

Arguments

x

matrix or dataframe with x- and y-coordinates

cellsize

length of gridcell side

crs

crs description suitable for st_crs

Details

The argument x will often be a traps or mask object with spacing attribute. Otherwise cellsize must be provided.

See make.grid for jittered locations within grid cells.

See Also

plotMaskEdge, spacing

Examples

Run this code

plot(gridCells(traps(captdata)))
plot(traps(captdata), add = TRUE)

Run the code above in your browser using DataLab