deletemaskpoints: Edit Mask Points

deleteMaskPointsR Documentation

Edit Mask Points


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



secr mask object


logical; see Details


logical; if true then the initial mask plot will be added to an existing plot


polygon defining habitat or non-habitat as described in make.mask


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.

See Also

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
    poly1 <- locator(5)
    mask3 <- deleteMaskPoints (mask0, poly = poly1)

secr documentation built on Oct. 18, 2023, 1:07 a.m.