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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Apr 22 16:04:00 CEST 2009


Author: rhijmans
Date: 2009-04-22 16:04:00 +0200 (Wed, 22 Apr 2009)
New Revision: 424

Added:
   pkg/raster/R/contour.R
   pkg/raster/man/contour.Rd
Modified:
   pkg/raster/DESCRIPTION
   pkg/raster/NAMESPACE
   pkg/raster/R/plot.R
   pkg/raster/man/distance.Rd
Log:


Modified: pkg/raster/DESCRIPTION
===================================================================
--- pkg/raster/DESCRIPTION	2009-04-22 12:02:00 UTC (rev 423)
+++ pkg/raster/DESCRIPTION	2009-04-22 14:04:00 UTC (rev 424)
@@ -1,8 +1,8 @@
 Package: raster
 Type: Package
 Title: Raster data handling for geographic data analysis and modeling
-Version: 0.8.9-13
-Date: 20-April-2009
+Version: 0.8.9-14
+Date: 22-April-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/NAMESPACE
===================================================================
--- pkg/raster/NAMESPACE	2009-04-22 12:02:00 UTC (rev 423)
+++ pkg/raster/NAMESPACE	2009-04-22 14:04:00 UTC (rev 424)
@@ -1,8 +1,8 @@
 importFrom("methods", Ops, Math)
-importFrom("graphics", hist, plot, lines)
+importFrom("graphics", hist, plot, lines, contour)
 importFrom("stats", aggregate)
 importFrom("utils", stack, unstack)
 importFrom("sp", overlay, bbox, Spatial, SpatialPixels, SpatialPixelsDataFrame, SpatialGrid, SpatialGridDataFrame)
 exportClasses(BoundingBox, BasicRaster, Raster, RasterLayer, RasterStack)
-exportMethods(raster, calc, overlay, bbox, aggregate, stack, unstack, show, summary, plot, hist, ncol, nrow, ncell, dim, Median)
+exportMethods(raster, calc, overlay, bbox, aggregate, stack, unstack, show, summary, plot, hist, contour, ncol, nrow, ncell, dim, Median)
 exportPattern("^[^\\.]")
\ No newline at end of file

Added: pkg/raster/R/contour.R
===================================================================
--- pkg/raster/R/contour.R	                        (rev 0)
+++ pkg/raster/R/contour.R	2009-04-22 14:04:00 UTC (rev 424)
@@ -0,0 +1,17 @@
+# Author: Robert J. Hijmans, r.hijmans at gmail.com
+# International Rice Research Institute
+# Date :  April 2009
+# Version 0.8
+# Licence GPL v3
+
+
+setMethod("contour", signature(x='RasterLayer'), 
+	function(x, ...)  {
+		if (dataContent(x) != 'all') { 
+#	to do: should  test if can read, else sample
+			x <- readAll(x) 
+		}
+		contour(x=xFromCol(x,1:ncol(x)), y=yFromRow(x, nrow(x):1), z=t((values(x, format='matrix'))[nrow(x):1,]), ...)
+	}
+)
+

Modified: pkg/raster/R/plot.R
===================================================================
--- pkg/raster/R/plot.R	2009-04-22 12:02:00 UTC (rev 423)
+++ pkg/raster/R/plot.R	2009-04-22 14:04:00 UTC (rev 424)
@@ -57,4 +57,4 @@
 		plot(x, y, cex=cex, ...)			
 	}
 )
-	
+

Added: pkg/raster/man/contour.Rd
===================================================================
--- pkg/raster/man/contour.Rd	                        (rev 0)
+++ pkg/raster/man/contour.Rd	2009-04-22 14:04:00 UTC (rev 424)
@@ -0,0 +1,40 @@
+\name{contour}
+
+\docType{methods}
+
+\alias{contour,RasterLayer-method}
+
+\title{Contour plot of a RasterLayer}
+
+\description{
+Contour plot of a RasterLayer.
+}
+
+\section{Methods}{
+\describe{
+
+\code{contour(x, ...)}
+
+\tabular{rll}{
+\tab \code{x} \tab a RasterLayer object \cr
+\tab \code{...}  \tab  Any argument that can be passed to \code{\link[graphics]{contour}} (graphics package) \cr
+}
+}}
+
+
+\details{
+
+}
+
+
+\author{ Robert J. Hijmans }
+
+\examples{ 
+r <- raster(nrows=36, ncols=18)
+r <- setValues(r, runif(ncell(r)))
+plot(r)
+}
+
+\keyword{methods}
+\keyword{spatial}
+

Modified: pkg/raster/man/distance.Rd
===================================================================
--- pkg/raster/man/distance.Rd	2009-04-22 12:02:00 UTC (rev 423)
+++ pkg/raster/man/distance.Rd	2009-04-22 14:04:00 UTC (rev 424)
@@ -30,13 +30,12 @@
 }
 
 
-
 \seealso{ For more options (directions, cost-distance) see the \code{ \link[gdistance]{gdistance}} package } 
 
 
 \examples{
 r1 <- raster(ncol=36,nrow=18)
-r1[] <- 0
+r1[] <- NA
 r1[345:355] <- 1
 distmap <- distance(r1) 
 #plot(distmap)



More information about the Raster-commits mailing list