Learn R Programming

secr (version 5.0.0)

Internal: Internal Functions

Description

Functions called internally by secr and exported but not usually called by users.

Usage

boundarytoSF (poly)

Dfn2(designD, beta = NULL, ...)

Value

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

Dfn2 -- Vector of density values on the link scale, suitable for the internal array (mask x groups x sessions).

Arguments

poly

data to define one or more polygons

designD

dataframe of density design data (output from D.designdata)

beta

numeric vector of beta values (see Details for NULL)

...

other arguments (not used)

Details

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

Possible inputs are:

InputFromNote
2-column matrix or dataframebase RSpatialPolygons
spSpatialPolygonsDataFramesp
SpatVectorterrasf
sfgeometry type POLYGON or MULTIPOLYGONsfc
sfgeometry type POLYGON or MULTIPOLYGON

Matrix input defines a single polygon.

Dfn2 is supplied automatically as 'details' argument Dfn in secr.fit when the switch Dlambda is set to TRUE for the multi-session trend reparameterization of density. Dfn2 uses beta = NULL to return the required number of density coefficients (beta parameters) in the model.

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,

predictDlambda, secr-trend.pdf,

Examples

Run this code

if (FALSE) {

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

}

Run the code above in your browser using DataLab