Learn R Programming

secr (version 4.5.3)

Internal: Internal Functions

Description

Functions called internally by secr and not exported.

Usage

boundarytoSF (poly)

Arguments

poly

data to define one or more polygons

Value

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

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 Input

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
# NOT RUN {
# }
# NOT RUN {
poly <- cbind(x = c(0,6,6,0,0), y = c(0,0,6,6,0))  
secr:::boundarytoSF(poly)

# }
# NOT RUN {
# }

Run the code above in your browser using DataLab