[Raster-commits] r137 - in pkg/raster: R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Jan 15 07:23:12 CET 2009
Author: rhijmans
Date: 2009-01-15 07:23:11 +0100 (Thu, 15 Jan 2009)
New Revision: 137
Modified:
pkg/raster/R/group.generic.functions.R
pkg/raster/man/Arith-methods.Rd
pkg/raster/man/Logic-methods.Rd
Log:
Modified: pkg/raster/R/group.generic.functions.R
===================================================================
--- pkg/raster/R/group.generic.functions.R 2009-01-14 23:54:19 UTC (rev 136)
+++ pkg/raster/R/group.generic.functions.R 2009-01-15 06:23:11 UTC (rev 137)
@@ -206,4 +206,21 @@
}
)
+setMethod("is.nan", signature(x='RasterLayer'),
+ function(x) {
+ return(setRaster(x, values=is.nan(.getRasterValues(x))))
+ }
+)
+setMethod("is.infinite", signature(x='RasterLayer'),
+ function(x) {
+ return(setRaster(x, values=is.infinite(.getRasterValues(x))))
+ }
+)
+
+setMethod("is.finite", signature(x='RasterLayer'),
+ function(x) {
+ return(setRaster(x, values=is.finite(.getRasterValues(x))))
+ }
+)
+
Modified: pkg/raster/man/Arith-methods.Rd
===================================================================
--- pkg/raster/man/Arith-methods.Rd 2009-01-14 23:54:19 UTC (rev 136)
+++ pkg/raster/man/Arith-methods.Rd 2009-01-15 06:23:11 UTC (rev 137)
@@ -6,7 +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: +, -, *, ^, /
+ Standard arithmic functions for computations with RasterLayer 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.
@@ -14,10 +14,10 @@
\author{Robert J. Hijmans \email{r.hijmans at gmail.com}}
\examples{
-r1 <- newRaster()
+r1 <- newRaster(ncols=10, nrows=10)
r1 <- setValues(r1, runif(ncells(r1)))
r2 <- setValues(r1, 1:ncells(r1)) / ncells(r1)
-r3 <- r1 * r2 - 1
+r3 <- r1 * (r2 - 1 + r1^2 / r2)
}
\keyword{methods}
Modified: pkg/raster/man/Logic-methods.Rd
===================================================================
--- pkg/raster/man/Logic-methods.Rd 2009-01-14 23:54:19 UTC (rev 136)
+++ pkg/raster/man/Logic-methods.Rd 2009-01-15 06:23:11 UTC (rev 137)
@@ -3,11 +3,18 @@
\alias{Logic-methods}
\alias{Logic,RasterLayer,RasterLayer-method}
\alias{is.na,RasterLayer-method}
+\alias{is.nan,RasterLayer-method}
+\alias{is.finite,RasterLayer-method}
+\alias{is.infinite,RasterLayer-method}
\title{ Methods for logical functions for RasterLayers' }
\description{
The following boolean operators are available: '&', '|'
- is.na(object) can also be called.
+ These are also available (with object being a RasterLayer, and the result a RasterLayer with logical values:
+ is.na(object)
+ is.nan(object)
+ is.finite(object)
+ is.infinite(object)
}
\keyword{methods}
More information about the Raster-commits
mailing list