Return all values of a Raster* object as a matrix. For RasterLayer objects this is a wrapper around getValues(x, format='matrix' and rows and columns in the matrix represent rows and columns in the RasterLayer object. For other Raster* objects a warpper around getValues(x), and each column represents a layer. If there is insufficient memory to load all values, you can use getValues or getValuesBlock to read chunks of the file.