ncell: Number or rows, columns, and cells of a Raster* object

Description Usage Arguments Value See Also Examples

Description

Get the number of rows, columns, or cells of a Raster* object.

Usage

1
2
3
4
5
ncol(x)
nrow(x)
ncell(x)
ncol(x, ...) <- value
nrow(x, ...) <- value

Arguments

x

a Raster object

value

row or column number (integer > 0)

...

additional arguments. None implemented

Value

Integer

See Also

dim, extent, res

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
r <- raster()
ncell(r)
ncol(r)
nrow(r)
dim(r)

nrow(r) <- 18
ncol(r) <- 36
# equivalent to
dim(r) <- c(18, 36) 

Example output

Loading required package: sp
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
[1] 64800
[1] 360
[1] 180
[1] 180 360   1

raster documentation built on Jan. 5, 2021, 3:01 a.m.