View source: R/spatVectorToSpatial.r
| spatVectorToSpatial | R Documentation |
This function converts a SpatVector object from the terra package to a Spatial object of the appropriate class (SpatialPoints, SpatialPointsDataFrame, SpatialPolygons, or SpatialPolygonsDataFrame) from the sp package. Note that sp is to be retired in 2023, so this function is to be come useful only for legacy applications.
spatVectorToSpatial(x)
x |
|
Object of class Spatial.
library(terra)
f <- system.file('ex/lux.shp', package='terra')
v <- vect(f)
spat <- spatVectorToSpatial(v)
class(spat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.