Learn R Programming

secrlinear (version 1.2.4)

clipmask: 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)

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).

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.

References

Pebesma, E. (2018) Simple features for R: standardized support for spatial vector data. The R Journal 10(1), 439--446. tools:::Rd_expr_doi("10.32614/RJ-2018-009")

See Also

make.line

Examples

Run this code
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)

Run the code above in your browser using DataLab