raster (version 1.6-19)

dimensions: Dimensions of a Raster* object

Description

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

Arguments

Value

  • Integer

Methods

dim(x) rll{ x Raster* object } dim(x) <- value rll{ x RasterLayer or RasterBrick) value row number, or row _and_ column number (for a RasterLayer and a RasterBrick); or a row and column number _and_ the number of layers (only for a RasterBrick) }

See Also

ncell, extent, res

Examples

Run this code
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)

Run the code above in your browser using DataCamp Workspace