gridcells: Construct Grid Cells

gridCellsR Documentation

Construct Grid Cells

Description

Forms grid cells centred on input points.

Usage


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

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.

Value

A simple features (sf) object of class ‘sfc_MULTIPOLYGON’.

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

See Also

plotMaskEdge, spacing

Examples


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

secr documentation built on Nov. 4, 2024, 9:06 a.m.