as.data.frame | R Documentation |
Coerce a SpatRaster or SpatVector to a data.frame
## S4 method for signature 'SpatVector'
as.data.frame(x, row.names=NULL, optional=FALSE, geom=NULL, ...)
## S4 method for signature 'SpatRaster'
as.data.frame(x, row.names=NULL, optional=FALSE, xy=FALSE,
cells=FALSE, time=FALSE, na.rm=NA, wide=TRUE, ...)
x |
SpatRaster or SpatVector |
geom |
character or NULL. If not NULL, either "WKT" or "HEX", to get the geometry included in Well-Known-Text or hexadecimal notation. If |
xy |
logical. If |
time |
logical. If |
na.rm |
logical. If |
cells |
logical. If |
wide |
logical. If |
... |
Additional arguments passed to the |
row.names |
This argument is ignored |
optional |
This argument is ignored |
data.frame
as.list, as.matrix
. See geom
to only extract the geometry of a SpatVector
f <- system.file("ex/lux.shp", package="terra")
v <- vect(f)
as.data.frame(v)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.