Coercion of a SpatRaster to a vector, matrix or array. Or coerce a SpatExtent to a vector or matrix
Usage
# 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 SpatExtent
as.vector(x, mode='any')
# S4 method for SpatExtent
as.matrix(x, ...)
Value
vector, matrix, or array
Arguments
x
SpatRaster or SpatVector
wide
logical. If FALSE each layer in the SpatRaster becomes a column in the matrix and each cell in the SpatRaster becomes a row. If TRUE each row in the SpatRaster becomes a row in the matrix and each column in the SpatRaster becomes a column in the matrix