powered by
Coercion to other object types
# S4 method for SpatRaster as.vector(x, mode='any')# S4 method for SpatRaster as.matrix(x, wide=FALSE)# S4 method for SpatRaster as.array(x)
# S4 method for SpatRaster as.matrix(x, wide=FALSE)
# S4 method for SpatRaster as.array(x)
SpatRaster or SpatVector
this argument is ignored
logical
vector, matrix, array
as.data.frame and as.polygons
as.data.frame
as.polygons
# NOT RUN { r <- rast(ncol=2, nrow=2) values(r) <- 1:ncell(r) as.vector(r) as.matrix(r) as.matrix(r, wide=TRUE) as.data.frame(r, xy=TRUE) as.array(r) # }
Run the code above in your browser using DataLab