## S3 method for class 'RasterLayer':
getValuesBlock(x, row=1, nrows=1, col=1, ncols=(ncol(x)-col+1), format='')
## S3 method for class 'RasterBrick':
getValuesBlock(x, row=1, nrows=1, col=1, ncols=(ncol(x)-col+1), lyrs)
## S3 method for class 'RasterStack':
getValuesBlock(x, row=1, nrows=1, col=1, ncols=(ncol(x)-col+1), lyrs)
format='matrix'
, a matrix is returned instead of a vector1:nlayers(x)
)(x=RasterLayer)
, unless format='matrix'
)getValues
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