deletemaskpoints: Edit Mask Points

Description Usage Arguments Details Value See Also Examples

Description

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.

Usage

1
2
deleteMaskPoints(mask, onebyone = TRUE, add = FALSE, poly = NULL,
 poly.habitat = FALSE, ...)

Arguments

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 make.mask

poly.habitat

logical; if TRUE polygon represents habitat

...

other arguments to plot.mask

Details

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 may be a SpatialPolygonsDataFrame from sp, possibly imported from a polygon shapefile with rgdal::readOGR. Whether poly represents habitat or non-habitat is toggled with poly.habitat – the default here differs from make.mask.

Value

A mask object, usually with fewer points than the input mask.

See Also

make.mask, subset.mask

Examples

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

secr documentation built on July 12, 2021, 9:07 a.m.