Last chance! 50% off unlimited learning
Sale ends in
make.mask(traps, buffer = 100, spacing = NULL, nx = 64, ny = 64, type =
c("traprect", "trapbuffer", "pdot", "polygon", "clusterrect",
"clusterbuffer", "rectangular"), poly = NULL, poly.habitat = TRUE,
keep.poly = TRUE, check.poly = TRUE, pdotmin = 0.001, ...)
traps
type = "pdot"
(optional)pdot
when type = "pdot"
mask
. When keep.poly = TRUE
,
poly
and poly.habitat
are saved as attributes of the
mask.traps
. Both `trapbuffer' and
`pdot' start with a `traprect' mask and drop some points.
The `trapbuffer' method restricts the grid to points within distance
buffer
of any detector.
The `pdot' method restricts the grid to points for which the net
detection probability $p.(\mathbf{X})$ (see
pdot
) is at least pdotmin
. Additional parameters
are used by pdot
(detectpar, noccasions). Set these with the
...argument; otherwise make.mask
will silently use the
arbitrary defaults. pdot
is currently limited to a halfnormal
detection function.
The `clusterrect' method constructs a grid of rectangular submasks
centred on `clusters' of detectors generated with
trap.builder
(possibly indirectly by
make.systematic
). The `clusterbuffer' method resembles
`trapbuffer', but is usually faster when traps are arranged in clusters
because it starts with a `clusterrect' mask.
The `rectangular' method constructs a simple rectangular mask with the
given nx, ny and spacing.
If poly
is specified, points outside poly
are dropped. The
`polygon' method places points on a rectangular grid clipped to the
polygon (buffer
is not used). Thus `traprect' is equivalent to
`polygon' when poly
is supplied. poly
may be either
spacing
is not specified then it is determined by dividing the
range of the x coordinates (including any buffer) by nx
.mask
, read.mask
, subset.mask
,
pdot
, buffer.contour
, deleteMaskPoints
temptrap <- make.grid(nx = 10, ny = 10, spacing = 30)
## default method: traprect
tempmask <- make.mask(temptrap, spacing = 5)
plot(tempmask)
summary (tempmask)
## make irregular detector array by subsampling
## form mask by `trapbuffer' method
temptrap <- subset (temptrap, sample(nrow(temptrap), size = 30))
tempmask <- make.mask (temptrap, spacing = 5, type = "trapbuffer")
plot (tempmask)
plot (temptrap, add = TRUE)
## form mask by "pdot" method
temptrap <- make.grid(nx = 6, ny = 6)
tempmask <- make.mask (temptrap, buffer = 150, type = "pdot",
pdotmin = 0.0001, detectpar = list(g0 = 0.1, sigma = 30),
noccasions = 4)
plot (tempmask)
plot (temptrap, add = TRUE)
## Using an ESRI polygon shapefile for clipping (shapefile
## polygons may include multiple islands and holes).
## Requires the `maptools' package of Nicholas J. Lewin-Koh, Roger
## Bivand, and others; `maptools' uses the `sp' package of spatial
## classes by Ed Pebesma and Roger Bivand.
library(maptools)
setwd(system.file("extdata", package = "secr"))
possumarea <- readShapePoly("possumarea") ## possumarea.shp etc.
possummask2 <- make.mask(traps(possumCH), spacing = 20,
buffer = 250, type = "trapbuffer", poly = possumarea)
par(mar = c(1,6,6,6), xpd = TRUE)
plot (possummask2, ppoly = TRUE)
plot(traps(possumCH), add = T)
par(mar = c(5,4,4,2) + 0.1, xpd = FALSE)
## if the polygon delineates non-habitat ...
seaPossumMask <- make.mask(traps(possumCH), buffer = 1000,
type = "traprect", poly = possumarea, poly.habitat = FALSE)
plot(seaPossumMask)
plot(traps(possumCH), add = T)
## this mask is not useful!
Run the code above in your browser using DataLab