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

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)

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 rgeos (Bivand and Rundel 2014).

References

Bivand, R. and Rundel, C. (2014) rgeos: Interface to Geometry Engine - Open Source (GEOS). R package version 0.3-4. https://CRAN.R-project.org/package=rgeos/

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)

if (require('rgeos')) {
  newmask <- clipmask(mask, trps, buffer = 200, clipvert = TRUE)
  plot(newmask)
  plot(trps, add = TRUE)
}

secrlinear

Spatially Explicit Capture-Recapture for Linear Habitats

v1.1.4
GPL (>= 2)
Authors
Murray Efford
Initial release
2021-05-04

We don't support your browser anymore

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