dim

0th

Percentile

Dimensions of a Raster* object

Get or set the number of rows, columns, and layers of a Raster* object. You cannot use this function to set the dimensions of a RasterStack object.

When setting the dimensions, you can provide a row number, or a vector with the row and the column number (for a RasterLayer and a RasterBrick), or a row and column number and the number of layers (only for a RasterBrick)

Keywords
spatial
Usage
# S4 method for BasicRaster
dim(x)
Arguments
x

Raster(* object

Value

Integer or Raster* object

See Also

ncell, extent, res

Aliases
  • dim
  • dim,RasterStackBrick-method
  • dim,BasicRaster-method
  • dim<-,BasicRaster-method
  • dim<-,RasterLayer-method
  • dim<-,RasterBrick-method
Examples
# NOT RUN {
r <- raster()
dim(r)
dim(r) <- c(18) 
dim(r)
dim(r) <- c(18, 36) 
dim(r)
b <- brick(r)
dim(b)
dim(b) <- c(10, 10, 5)
dim(b)
# }
Documentation reproduced from package raster, version 2.9-5, License: GPL (>= 3)

Community examples

Looks like there are no examples yet.