deleteMaskPoints | R Documentation |
Mask points may be removed by one of three methods: clicking on points, clicking on vertices to define a polygon from which points will be removed, or specifying a polygon to which the mask will be clipped.
deleteMaskPoints(mask, onebyone = TRUE, add = FALSE, poly = NULL,
poly.habitat = FALSE, ...)
mask |
secr mask object |
onebyone |
logical; see Details |
add |
logical; if true then the initial mask plot will be added to an existing plot |
poly |
polygon defining habitat or non-habitat as described in
|
poly.habitat |
logical; if TRUE polygon represents habitat |
... |
other arguments to plot.mask |
The default method (onebyone = TRUE, poly = NULL) is to click on each point to be removed. The nearest mask point will be selected.
Setting onebyone = FALSE allows the user to click on the vertices of a
polygon within which all points are to be removed (the default) or
retained (poly.habitat = TRUE
). Vertices need not
coincide with mask points.
Defining poly
here is equivalent to calling make.mask
with poly
defined. poly
one of the several types described
in boundarytoSF
. Whether poly
represents habitat or
non-habitat is toggled with poly.habitat
– the default here
differs from make.mask
.
A mask object, usually with fewer points than the input mask.
make.mask
, subset.mask
if (interactive()) {
mask0 <- make.mask (traps(captdata))
## Method 1 - click on each point to remove
mask1 <- deleteMaskPoints (mask0)
## Method 2 - click on vertices of removal polygon
mask2 <- deleteMaskPoints (mask0, onebyone = FALSE)
## Method 3 - predefined removal polygon
plot(captdata)
poly1 <- locator(5)
mask3 <- deleteMaskPoints (mask0, poly = poly1)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.