Description Usage Arguments Details Value See Also Examples
These functions get the row and/or column number from a cell number of a Raster* object)
1 2 3 | colFromCell(object, cell)
rowFromCell(object, cell)
rowColFromCell(object, cell)
|
object |
Raster* object (or a SpatialPixels* or SpatialGrid* object) |
cell |
cell number(s) |
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.
row of column number(s)
1 2 3 4 | r <- raster(ncols=10, nrows=10)
colFromCell(r, c(5,15))
rowFromCell(r, c(5,15))
rowColFromCell(r, c(5,15))
|
Loading required package: sp
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
[1] 5 5
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
[1] 1 2
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
row col
[1,] 1 5
[2,] 2 5
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.