Learn R Programming

secr (version 4.5.8)

Internal: Internal Functions

Description

Functions called internally by secr and not exported.

Usage

boundarytoSF (poly)

Value

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

Arguments

poly

data to define one or more polygons

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.

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

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