values
is a shorthand version of getValues (for all rows).getValues(x, row, nrows, ...)
values(x, ...)
RasterLayer
: format
to specifiy the output format. Either "matrix" or, the default "", in which case a vector is returnedgetValuesBlock, getValuesFocal, setValues
r <- raster(system.file("external/test.grd", package="raster"))
r
v <- getValues(r)
length(v)
head(v)
getValues(r, row=10)
Run the code above in your browser using DataLab