[Raster-commits] r136 - in pkg/raster: . R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jan 15 00:54:20 CET 2009


Author: rhijmans
Date: 2009-01-15 00:54:19 +0100 (Thu, 15 Jan 2009)
New Revision: 136

Modified:
   pkg/raster/DESCRIPTION
   pkg/raster/R/replacement.R
   pkg/raster/man/Arith-methods.Rd
   pkg/raster/man/classes.Rd
   pkg/raster/man/overlay.Rd
Log:


Modified: pkg/raster/DESCRIPTION
===================================================================
--- pkg/raster/DESCRIPTION	2009-01-14 09:26:54 UTC (rev 135)
+++ pkg/raster/DESCRIPTION	2009-01-14 23:54:19 UTC (rev 136)
@@ -2,7 +2,7 @@
 Type: Package
 Title: Raster data handling for geographic data analysis and modeling
 Version: 0.8.5
-Date: 13-Jan-2009
+Date: 14-Jan-2009
 Depends: methods, sp, rgdal (>= 0.5-33), R (>= 2.8.0)
 Author: Robert J. Hijmans & Jacob van Etten
 Maintainer: Robert J. Hijmans <r.hijmans at gmail.com> 

Modified: pkg/raster/R/replacement.R
===================================================================
--- pkg/raster/R/replacement.R	2009-01-14 09:26:54 UTC (rev 135)
+++ pkg/raster/R/replacement.R	2009-01-14 23:54:19 UTC (rev 136)
@@ -25,17 +25,33 @@
 	}
 )
 
+
+setMethod("[", "RasterStack",
+	function(x,i,j,layer,...,drop=FALSE) {
+		if  (!missing(layer)) {	stop("incorrect number of dimensions") }
+		if  (missing(j)) {	return(values(x)[i, ]) 
+		} else {
+			v <- valuesRow(x,j)
+			return(v[i])
+		}
+	}
+)
+
+
 setMethod("[", "RasterLayer",
-	function(x,i,j,...,drop=FALSE) {
-# if ...
-		return(values(x)[i])
+	function(x,i,j,layer,...,drop=FALSE) {
+		if  (!missing(layer)) {	stop("incorrect number of dimensions") }
+		if  (missing(j)) {	return(values(x)[i]) 
+		} else {
+			v <- valuesRow(x,j)
+			return(v[i])
+		}
 	}
 )
 
 
 setMethod("[[", c("RasterLayer", "ANY", "missing"), 
 	function(x, i, j, ...) {
-# if ...
 		return(values(x)[i])
 	}
 )

Modified: pkg/raster/man/Arith-methods.Rd
===================================================================
--- pkg/raster/man/Arith-methods.Rd	2009-01-14 09:26:54 UTC (rev 135)
+++ pkg/raster/man/Arith-methods.Rd	2009-01-14 23:54:19 UTC (rev 136)
@@ -6,10 +6,7 @@
 \alias{Arith,RasterLayer,RasterLayer-method}
 \title{Methods for arithmic function for RasterLayer objects}
 \description{
-  The following standard arithmic functions can be used for computations with RasterLayers objects and numeric values.
-\begin{verbatim}  
-  "+", "-", "*", "^", "%%", "%/%", "/" 
-\end{verbatim}  
+  The following standard arithmic functions can be used for computations with RasterLayers objects and numeric values: +, -, *, ^, /
 }
 \section{Note}{
  The RasterLayer objects must have either all data in memory or on disk. If the data do not fit into memory you should use the Overlay() function instead.

Modified: pkg/raster/man/classes.Rd
===================================================================
--- pkg/raster/man/classes.Rd	2009-01-14 09:26:54 UTC (rev 135)
+++ pkg/raster/man/classes.Rd	2009-01-14 23:54:19 UTC (rev 136)
@@ -20,6 +20,7 @@
 \alias{summary,RasterLayer-method}
 \alias{summary,RasterStackBrick-method}
 \alias{[,RasterLayer-method}
+\alias{[,RasterStack-method}
 \alias{[<-,RasterLayer,ANY,missing-method}
 \alias{[[,RasterLayer,ANY,missing-method}
 \alias{[[<-,RasterLayer,ANY,missing-method}

Modified: pkg/raster/man/overlay.Rd
===================================================================
--- pkg/raster/man/overlay.Rd	2009-01-14 09:26:54 UTC (rev 135)
+++ pkg/raster/man/overlay.Rd	2009-01-14 23:54:19 UTC (rev 136)
@@ -21,8 +21,8 @@
 
 \details{
   The default function of Overlay sums the two rasters. Here are two other examples of functions that you can use:
-  multiply: fun=function(x,y){return(x*y)}
-  percentage: fun=function(x,y){return(100 * x / y)}
+  multiply: \code{fun=function(x,y){return(x*y)}}
+  percentage: \code{fun=function(x,y){return(100 * x / y)}}
   
   some overlay functions have been implemented as generic functions (*, /, +, -)
   



More information about the Raster-commits mailing list