getValues returns all values or the values for a number of rows of a Raster* object.
values is a shorthand version of getValues (for all rows).
Usage
getValues(x, row, nrows, ...)
values(x, ...)
Arguments
x
Raster* object
row
Numeric. Row number, should be between 1 and nrow(x), or missing in which case all values are returned
nrows
Numeric. Number of rows. Should be an integer number > 0, or missing
...
Additional arguments, see Details
Value
vector or matrix of raster values
Details
Additional arguments when x is a RasterLayer:
format Character. specifiy the output format. Either "" or "matrix". The default is "", in which case a vector is returned.
The values returned for a RasterStack or RasterBrick are always a matrix, with the rows representing cells, and the columns representing layers.