powered by
Coerce a SpatRaster or SpatVector to a data.frame
# S4 method for SpatVector as.data.frame(x, row.names=NULL, optional=FALSE, geom=NULL, ...)# S4 method for SpatRaster as.data.frame(x, row.names=NULL, optional=FALSE, xy=FALSE, cells=FALSE, time=FALSE, na.rm=NA, wide=TRUE, ...)
# S4 method for SpatRaster as.data.frame(x, row.names=NULL, optional=FALSE, xy=FALSE, cells=FALSE, time=FALSE, na.rm=NA, wide=TRUE, ...)
data.frame
as.list, as.matrix. See geom to only extract the geometry of a SpatVector
as.list, as.matrix
geom
f <- system.file("ex/lux.shp", package="terra") v <- vect(f) as.data.frame(v)
Run the code above in your browser using DataLab