getValuesBlock(x, row, ...)
(x=RasterLayer)
or matrixnrows
Integer. How many rows? Default is 1
col
Integer. Start column. Default is 1
ncols
Integer. How many columns? Default is the number of colums left after the start column
lyrs
Integer (vector). Which layers? Default is all layers (1:nlayers(x)
)
}r <- raster(system.file("external/test.grd", package="raster"))
b <- getValuesBlock(r, row=100, nrows=3, col=10, ncols=5)
b
b <- matrix(b, nrow=3, ncol=5, byrow=TRUE)
b
logo <- brick(system.file("external/rlogo.grd", package="raster"))
getValuesBlock(logo, row=35, nrows=3, col=50, ncols=3, lyrs=2:3)
Run the code above in your browser using DataLab