Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

make.systematic

Construct Systematic Detector Design


Description

A rectangular grid of clusters within a polygonal region.

Usage

make.systematic(n, cluster, region, spacing = NULL, origin = NULL, 
    originoffset = c(0,0), chequerboard = c('all','black','white'), 
    order = c('x', 'y', 'xb', 'yb'), rotate = 0,  centrexy = 
    apply(bbox(region),1,mean), keep.design = TRUE, ...)

Arguments

n

integer approximate number of clusters (see Details)

cluster

traps object defining a single cluster

region

dataframe or SpatialPolygonsDataFrame with coordinates of perimeter

spacing

scalar distance between cluster centres

origin

vector giving x- and y-cooordinates of fixed grid origin (origin is otherwise random)

originoffset

numeric; 2-vector (x,y offsets); see Details

chequerboard

logical; if not ‘all’ then alternate clusters are omitted

order

character; sort order for clusters (see Details)

rotate

numeric; number of degrees by which to rotate entire design clockwise about centroid of region bounding box

centrexy

numeric; 2-vector for centre of rotation, if any

keep.design

logical; if TRUE then input argument values are retained

...

arguments passed to trap.builder

Details

region may be any shape. The sp class SpatialPolygonsDataFrame is useful for complex shapes and input from shapefiles using rgdal (see Examples). Otherwise, region should be a dataframe with columns ‘x’ and ‘y’.

spacing may be a vector with separate values for spacing in x- and y- directions. If spacing is provided then n is ignored.

If n is a scalar, the spacing of clusters is determined from the area of the bounding box of region divided by the requested number of clusters (this does not necessarily result in exactly n clusters). If n is a vector of two integers these are taken to be the number of columns and the number of rows.

After preparing a frame of cluster centres, make.systematic calls trap.builder with method = ‘all’; ... allows the arguments ‘rotation’, ‘edgemethod’, ‘plt’, and ‘detector’ to be passed. Setting the trap.builder arguments frame, method, and samplefactor has no effect.

Note the distinction between argument rotate and the trap.builder argument rotation that is applied separately to each cluster.

If origin is not specified then a random uniform origin is chosen within a box (width = spacing) placed with its bottom left corner at the bottom left of the bounding box of region, shifted by originoffset. Before version 3.1.8 the behaviour of make.systematic was equivalent to originoffset = c(wx,wy) where wx,wy are the cluster half widths.

chequerboard = "black" retains black ‘squares’ and chequerboard = "white" retains white ‘squares’, where the lower left cluster in the candidate rectangle of cluster origins is black, as on a chess board. The effect is the same as increasing spacing by sqrt(2) and rotating through 45 degrees.

order determines the ordering of clusters in the resulting traps object. The options are a subset of those for ID argument of make.grid:

Option Sort order
x column-dominant
y row-dominant
xb column-dominant boustrophedonical (alternate columns reversed)
yb row-dominant boustrophedonical (alternate rows reversed)

rotate rotates the array about the given centre (default is centroid of the bounding box of region). Rotation requires package maptools to have been installed; non-zero values otherwise result in a warning.

Value

A single-session ‘traps’ object.

From 3.2.0 these additional attributes are set –

origin coordinates of grid origin
centres coordinates of true cluster centres (cf cluster.centres)
originbox vertices of rectangular spatial sampling frame for random origin

From 4.2.0 if keep.design is TRUE then the input argument values are retained in attribute ‘design’ (a list with first component function = 'make.systematic').

Note

Do not confuse with the simpler function make.grid, which places single detectors in a rectangular array.

See Also

Examples

mini <- make.grid(nx = 2, ny = 2, spacing = 100)
region <- cbind(x=c(0,2000,2000,0), y=c(0,0,2000,2000))
temp <- make.systematic(25, mini, region, plt = TRUE)
temp <- make.systematic(c(6, 6), mini, region, plt = TRUE,
    rotation = -1)

## Example using shapefile "possumarea.shp" in
## "extdata" folder. By default, each cluster is 
## a single multi-catch detector

## Not run: 

datadir <- system.file("extdata", package = "secr")
possumarea <- rgdal::readOGR(dsn = datadir, layer = "possumarea")

possumgrid <- make.systematic(spacing = 100, region =
    possumarea, plt = TRUE)

## or with 2 x 2 clusters
possumgrid2 <- make.systematic(spacing = 300,
    cluster = make.grid(nx = 2, ny = 2, spacing = 100),
    region = possumarea, plt = TRUE, edgemethod =
    "allinside")
## label clusters
text(cluster.centres(possumgrid2), levels(clusterID
    (possumgrid2)), cex=0.7)

## If you have GPSBabel installed and on the Path
## then coordinates can be projected and uploaded
## to a GPS with `writeGPS', which also requires the
## package `proj4'. Defaults are for a Garmin GPS
## connected by USB.

writeGPS(possumgrid, proj = "+proj=nzmg")


## End(Not run)

secr

Spatially Explicit Capture-Recapture

v4.4.1
GPL (>= 2)
Authors
Murray Efford
Initial release
2021-05-01

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.