rowFromCell

0th

Percentile

Row or column number from a cell number

These functions get the row and/or column number from a cell number of a Raster* object)

Keywords
spatial
Usage
colFromCell(object, cell)
rowFromCell(object, cell)
rowColFromCell(object, cell)
Arguments
object

Raster* object (or a SpatialPixels* or SpatialGrid* object)

cell

cell number(s)

Details

The colFromCell and similar functions accept a single value, or a vector or list of these values, Cell numbers start at 1 in the upper left corner, and increase from left to right, and then from top to bottom. The last cell number equals the number of cells of the Raster* object.

Value

row of column number(s)

See Also

cellFrom

Aliases
  • rowFromCell
  • rowFromCell,BasicRaster,numeric-method
  • colFromCell
  • colFromCell,BasicRaster,numeric-method
  • rowColFromCell
  • rowColFromCell,BasicRaster,numeric-method
Examples
# NOT RUN {
r <- raster(ncols=10, nrows=10)
colFromCell(r, c(5,15))
rowFromCell(r, c(5,15))
rowColFromCell(r, c(5,15))
# }
Documentation reproduced from package raster, version 2.9-5, License: GPL (>= 3)

Community examples

Looks like there are no examples yet.