raster (version 1.1.7)

values: Get raster values

Description

This function will be removed shortly. Use getValues instead. It returns the raster cell values for a RasterLayer or RasterBrick object that are currently in memory (typically after read* has been used).

Usage

values(x, ...)

Arguments

x
RasterLayer or RasterBrick object
...
Additional arguments. These are only relevant if x is a RasterLayer object. With the argument format='matrix' the function returns a matrix in stead of a vector; and in that case a further argument 'names=TRUE', will add row and column names

Value

  • a vector or matrix

Details

In most cases it is better to use getValues rather than values. values is typically used in functions after a read* function has been used and it will return all the values that happen to be in memory at that point, or fail if there are no values in memory. In contrast getValues will read values from disk if necessary.

See Also

getValues, read

Examples

Run this code
r <- raster(ncol=10, nrow=10)
r <- setValues(r, 1:ncell(r))
values(r)

Run the code above in your browser using DataLab