clipmask {secrlinear} | R Documentation |
Drop Points Distant From Detectors
Description
clipmask
may be used to drop superfluous points from a mask
(those further than buffer
from any detector).
Usage
clipmask(mask, traps, buffer = 100, clipvert = FALSE)
Arguments
traps |
‘traps’ object from secr |
mask |
‘linearmask’ object |
buffer |
network distance for retaining mask points (m) |
clipvert |
logical; if TRUE the underlying lines are also clipped |
Details
None yet.
Value
‘linearmask’ object retaining only points within buffer
m of
any trap. By default, the ‘SLDF’ attribute is
unchanged.
clipvert = TRUE
causes the attribute “SLDF” (a
SpatialLinesDataFrame) to be clipped to within spacing/2 of detectors,
using functions from sf (Pebesma 2018).
References
Pebesma, E. (2018) Simple features for R: standardized support for spatial vector data. The R Journal 10(1), 439–446. doi:10.32614/RJ-2018-009
See Also
Examples
x <- seq(0, 4*pi, length = 200)
xy <- data.frame(x = x*100, y = sin(x)*300)
mask <- read.linearmask(data = xy, spacing = 20)
## clipmask
trps <- make.line(mask, n = 15, startbuffer = 1000, by = 30)
newmask <- clipmask(mask, trps, buffer = 200)
plot(newmask)
plot(trps, add = TRUE)
newmask <- clipmask(mask, trps, buffer = 200, clipvert = TRUE)
plot(newmask)
plot(trps, add = TRUE)
[Package secrlinear version 1.2.2 Index]