Internal {secr}R Documentation

Internal Functions

Description

Various functions called internally by secr and not exported.

Usage


boundarytoSF (poly)

esaPlotsecr (object, max.buffer = NULL, max.mask = NULL,
    thin = 0.1, poly = NULL, poly.habitat = TRUE, session = 1, plt = TRUE, 
    type = "density", add = FALSE, overlay = TRUE, conditional = FALSE, ...)

Arguments

poly

data to define one or more polygons

object

secr object output from secr.fit

max.buffer

maximum width of buffer in metres

max.mask

mask object

thin

proportion of mask points to retain in plot and output

poly.habitat

logical as in make.mask

session

vector of session indices (used if object spans multiple sessions)

plt

logical to plot results

type

character; see esaPlot

add

logical to add line to an existing plot

overlay

logical; if TRUE then automatically add = TRUE for plots after the first

conditional

logical; see esaPlot

...

other arguments not used (boumndarytoSF, Dfn2) or graphical arguments passed to plot() and lines() (esaPlotsecr)

Details

The function boundarytoSF converts various possible polygon input formats to a standard form (sfc).

Possible inputs are:

Input From Note
2-column matrix or dataframe base R
SpatialPolygons sp
SpatialPolygonsDataFrame sp
SpatVector terra
sf sf geometry type POLYGON or MULTIPOLYGON
sfc sf geometry type POLYGON or MULTIPOLYGON

Matrix input defines a single polygon.

esaPlotsecr provides a wrapper for esaPlot that is called internally from esaPlot when it is presented with an secr object. Arguments of esaPlot such as detectfn are inferred from the fitted model.

The optional ‘poly’ argument of esaPlotsecr is a matrix of two columns interpreted as the x and y coordinates of a bounding polygon.

If max.mask is not specified then a maximal mask of type ‘trapbuffer’ is constructed using max.buffer and the spacing of the mask in object. In this case, if max.buffer is not specified then it is set either to the width of the existing plot (add = TRUE) or to 10 x sigma-hat from the fitted model in object (add = FALSE).

Value

boundarytoSF – Spatial object of sf class sfc, containing a geometry set of type POLYGON or MULTIPOLYGON. NULL input results in NULL output.

esaPlotsecr – see esaPlot

References

Hijmans, R. J. (2022) terra: Spatial Data Analysis. R package version 1.5-14. https://rspatial.org/terra/

Pebesma, E. (2018) Simple features for R: standardized support for spatial vector data. The R Journal 10(1), 439–446. https://doi.org/10.32614/RJ-2018-009

Pebesma, E.J. and Bivand, R. S. (2005) Classes and methods for spatial data in R. R News 5(2), 9–13. https://cran.r-project.org/doc/Rnews/Rnews_2005-2.pdf.

See Also

pointsInPolygon, secr-spatialdata.pdf,

Examples


## Not run: 

poly <- cbind(x = c(0,6,6,0,0), y = c(0,0,6,6,0))  
secr:::boundarytoSF(poly)


## End(Not run)


[Package secr version 5.0.0 Index]