Drop Points Distant From Detectors

Share:

Description

clipmask may be used to drop superfluous points from a mask (those further than buffer from any detector).

Usage

1
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. http://CRAN.R-project.org/package=rgeos

See Also

make.line

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
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)
}