spatVectorToSpatial: Convert SpatVector to Spatial*

View source: R/spatVectorToSpatial.r

spatVectorToSpatialR Documentation

Convert SpatVector to Spatial*

Description

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.

Usage

spatVectorToSpatial(x)

Arguments

x

SpatVector object.

Value

Object of class Spatial.

Examples


library(terra)
f <- system.file('ex/lux.shp', package='terra')
v <- vect(f)
spat <- spatVectorToSpatial(v)
class(spat)


enmSdmX documentation built on April 3, 2025, 7:50 p.m.