Learn R Programming

secr (version 3.2.1)

deleteMaskPoints: Edit Mask Points

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

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

Value

A mask object, usually with fewer points than the input 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.

See Also

make.mask, subset.mask

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
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)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab