[Raster-commits] r408 - pkg/raster/man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Apr 15 09:21:08 CEST 2009


Author: rhijmans
Date: 2009-04-15 09:21:08 +0200 (Wed, 15 Apr 2009)
New Revision: 408

Added:
   pkg/raster/man/rasterFromCells.Rd
Modified:
   pkg/raster/man/cellFrom.Rd
Log:


Modified: pkg/raster/man/cellFrom.Rd
===================================================================
--- pkg/raster/man/cellFrom.Rd	2009-04-15 05:05:23 UTC (rev 407)
+++ pkg/raster/man/cellFrom.Rd	2009-04-15 07:21:08 UTC (rev 408)
@@ -1,44 +1,50 @@
-\name{rasterFromCells}
+\name{cellFrom}
 
-\alias{rasterFromCells}
+\alias{cellFromRowCol}
+\alias{cellFromRowColCombine}
+\alias{cellFromRow}
+\alias{cellFromCol}
 
   
-\title{Subset a raster by cell numbers}
+\title{Get cell number}
 
 \description{
-This function returns a new raster based on an existing raster and cell numbers for that raster.
-The new raster is cropped to the cellnumbers provided, and has values that are the cell numbers of the original raster.
+Get cell number(s) of a Raster* object from row and/or column numbers.   
+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.
 }
 
 \usage{
-rasterFromCells(object, cells)
+cellFromRowCol(object, rownr, colnr)
+cellFromRowColCombine(object, rownr, colnr)
+cellFromRow(object, rownr)
+cellFromCol(object, colnr)
 }
 
 \arguments{
   \item{object}{Raster* object (or a SpatialPixels* or SpatialGrid* object)}
-  \item{cells}{vector of cell numbers}
+  \item{colnr}{column number; or vector of column numbers}
+  \item{rownr}{row number; or vector of row numbers}
 }
   
 \details{
-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.
- 
+  In \code{cellFromRowCol}, \code{rownr} and  \code{colnr} should have the same length.
+  This is not the case for \code{cellFromRowColCombine}. This function returns the cell numbers obtained by 
+  the combination of row and column numbers.
 }
 
 \value{
-A RasterLayer
+cell number(s) 
 }
-
-\seealso{ \code{\link[raster]{rowFromCell}} }
-
-
 \author{Robert J. Hijmans }
 
 \examples{
-r <- raster(ncols=100, nrows=100)
-cells <- c(3:5, 210)
-r <- rasterFromCells(r, cells)
-cbind(1:ncell(r), values(r))
+r <- raster(ncols=10, nrows=10)
+cellFromRowCol(r, 5, 5)
+cellFromRowCol(r, 1:2, 1:2)
+cellFromRowColCombine(r, 1:3, 1:2)
+cellFromCol(r, 1)
+cellFromRow(r, 1)
 }
 
 \keyword{spatial}

Added: pkg/raster/man/rasterFromCells.Rd
===================================================================
--- pkg/raster/man/rasterFromCells.Rd	                        (rev 0)
+++ pkg/raster/man/rasterFromCells.Rd	2009-04-15 07:21:08 UTC (rev 408)
@@ -0,0 +1,44 @@
+\name{rasterFromCells}
+
+\alias{rasterFromCells}
+
+  
+\title{Subset a raster by cell numbers}
+
+\description{
+This function returns a new raster based on an existing raster and cell numbers for that raster.
+The new raster is cropped to the cellnumbers provided, and has values that are the cell numbers of the original raster.
+}
+
+\usage{
+rasterFromCells(object, cells)
+}
+
+\arguments{
+  \item{object}{Raster* object (or a SpatialPixels* or SpatialGrid* object)}
+  \item{cells}{vector of cell numbers}
+}
+  
+\details{
+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{
+A RasterLayer
+}
+
+\seealso{ \code{\link[raster]{rowFromCell}} }
+
+
+\author{Robert J. Hijmans }
+
+\examples{
+r <- raster(ncols=100, nrows=100)
+cells <- c(3:5, 210)
+r <- rasterFromCells(r, cells)
+cbind(1:ncell(r), values(r))
+}
+
+\keyword{spatial}



More information about the Raster-commits mailing list