values

0th

Percentile

Get raster values

This function returns the raster cell values for a RasterLayer or RasterBrick object that are currently in memory (typically after read* has been used).

Keywords
methods, spatial
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
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.

Value

  • a vector or matrix

See Also

getValues, read

Aliases
  • values
  • values,RasterLayer-method
  • values,RasterBrick-method
Examples
r <- raster(ncol=10, nrow=10)
r <- setValues(r, 1:ncell(r))
values(r)
r <- raster(system.file("external/test.grd", package="raster"))
r <- readBlock(r, startrow=100, nrows=3, startcol=5, ncolumns=5)
values(r, format='matrix', names=TRUE)
Documentation reproduced from package raster, version 1.0.0-1, License: GPL (>= 3)

Community examples

Looks like there are no examples yet.