Last chance! 50% off unlimited learning
Sale ends in
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.data.frame(x, xy=FALSE, cells=FALSE, ...)
# S4 method for SpatRaster
as.array(x, ...)
# S4 method for SpatRaster
as.polygons(x, values=FALSE, na.rm=FALSE, ...)
# S4 method for SpatRaster
as.points(x, values=FALSE, na.rm=FALSE, ...)
# S4 method for SpatVector
as.lines(x, ...)
SpatRaster
logical
logical
logical
this argument is ignored
logical; include cell values as attributes?
logical; exclude cells with NAs?
additional arguments. None implemented
vector, matrix, array, data.frame or SpatVector
# 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)
as.polygons(r)
as.points(r)
# }
Run the code above in your browser using DataLab