as.vector returns a vector of cell values. For a RasterLayer it is equivalent to getValues(x).
as.matrix returns all values of a Raster* object as a matrix. For RasterLayers, rows and columns in the matrix represent rows and columns in the RasterLayer object. For other Raster* objects, the matrix returned by
as.matrix has columns for each layer and rows for each cell.
as.array returns an array of matrices that are like those returned by
as.matrix for a RasterLayer
If there is insufficient memory to load all values, you can use
getValuesBlock to read chunks of the file.
as.vector can also be used to obtain the coordinates from an Extent object.
1 2 3 4 5 6 7 8
Raster* or (for
Character string giving an atomic mode (such as "numeric" or "character") or "list", or "any". Note: this argument is currently ignored!
matrix, array, or vector
1 2 3 4 5 6
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.