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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Apr 18 07:08:59 CEST 2009


Author: rhijmans
Date: 2009-04-18 07:08:58 +0200 (Sat, 18 Apr 2009)
New Revision: 413

Added:
   pkg/raster/R/setExtent.R
   pkg/raster/R/shift.R
   pkg/raster/man/coordinates.Rd
Removed:
   pkg/raster/R/changeExtent.R
   pkg/raster/R/setBbox.R
   pkg/raster/man/changeExtent.Rd
   pkg/raster/man/extent.Rd
Modified:
   pkg/raster/DESCRIPTION
   pkg/raster/R/crop.R
   pkg/raster/R/map.R
   pkg/raster/R/readSkip.R
   pkg/raster/R/reclass.R
   pkg/raster/R/replaceProperties.R
   pkg/raster/R/set.R
   pkg/raster/man/LinesToRaster.Rd
   pkg/raster/man/PolygonsToRaster.Rd
   pkg/raster/man/aggregate.Rd
   pkg/raster/man/calc.Rd
   pkg/raster/man/crop.Rd
   pkg/raster/man/disaggregate.Rd
   pkg/raster/man/distance.Rd
   pkg/raster/man/focal.Rd
   pkg/raster/man/focalFilter.Rd
   pkg/raster/man/init.Rd
   pkg/raster/man/merge.Rd
   pkg/raster/man/pointsToRaster.Rd
   pkg/raster/man/project.Rd
   pkg/raster/man/reclass.Rd
   pkg/raster/man/resample.Rd
   pkg/raster/man/setDatatype.Rd
   pkg/raster/man/setExtent.Rd
   pkg/raster/man/setNAvalue.Rd
   pkg/raster/man/writeStack.Rd
Log:


Modified: pkg/raster/DESCRIPTION
===================================================================
--- pkg/raster/DESCRIPTION	2009-04-18 03:22:58 UTC (rev 412)
+++ pkg/raster/DESCRIPTION	2009-04-18 05:08:58 UTC (rev 413)
@@ -1,8 +1,8 @@
 Package: raster
 Type: Package
 Title: Raster data handling for geographic data analysis and modeling
-Version: 0.8.9-12
-Date: 17-April-2009
+Version: 0.8.9-13
+Date: 18-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> 

Deleted: pkg/raster/R/changeExtent.R
===================================================================
--- pkg/raster/R/changeExtent.R	2009-04-18 03:22:58 UTC (rev 412)
+++ pkg/raster/R/changeExtent.R	2009-04-18 05:08:58 UTC (rev 413)
@@ -1,26 +0,0 @@
-# R function for the raster package
-# Author: Robert J. Hijmans
-# International Rice Research Institute. Philippines
-# contact: r.hijmans at gmail.com
-# Date : January 2009
-# Version 0.8
-# Licence GPL v3
-
-
-
-changeExtent <- function(x, xmn=xmin(x), xmx=xmax(x), ymn=ymin(x), ymx = ymax(x), keepres=FALSE) {
-	bb <- newBbox(xmn, xmx, ymn, ymx) 
-	if (class(x) == 'BoundingBox') { 
-		return(bb)
-	}
-	x <- setExtent(x, bb, keepres=keepres) 
-	return(x)
-}
-
-shift <- function(object, x=0, y=0) {
-	object at bbox@xmin <- object at bbox@xmin + x
-	object at bbox@ymin <- object at bbox@ymin + y
-	object at bbox@xmax <- object at bbox@xmax + x
-	object at bbox@ymax <- object at bbox@ymax + y
-	return(object)
-}

Modified: pkg/raster/R/crop.R
===================================================================
--- pkg/raster/R/crop.R	2009-04-18 03:22:58 UTC (rev 412)
+++ pkg/raster/R/crop.R	2009-04-18 05:08:58 UTC (rev 413)
@@ -7,13 +7,14 @@
 # Licence GPL v3
 
 
-crop <- function(raster, bndbox, filename="", overwrite=FALSE, filetype='raster', track=-1) {
+crop <- function(raster, bndbox, filename="", overwrite=FALSE, filetype='raster', datatype=dataType(raster), track=-1) {
 
 # we could also allow the raster to expand but for now let's not and first make a separate expand function
 	bb <- intersectBbox(raster, bndbox)
 	bb <- alignBbox(bb, raster)
 	outraster <- raster(raster, filename)
 	outraster <- setExtent(outraster, bb, keepres=TRUE)
+	dataType(outraster) <- datatype
 	
 	if (dataContent(raster) == 'all')  {
 		first_start_cell <- cellFromXY(raster, c(xmin(outraster) + 0.5 * xres(raster), ymax(outraster) - 0.5 * yres(raster) ))	

Modified: pkg/raster/R/map.R
===================================================================
--- pkg/raster/R/map.R	2009-04-18 03:22:58 UTC (rev 412)
+++ pkg/raster/R/map.R	2009-04-18 05:08:58 UTC (rev 413)
@@ -39,10 +39,9 @@
 
 			sampraster <- raster(object)
 			sampraster <- setRowCol(sampraster, dim(m)[1], dim(m)[2])
-			xmx <- xmax(object) - (ncol(object) - cols[length(cols)]) * xres(object)
-			ymn <- ymin(object) + (nrow(object) - rows[length(rows)]) * yres(object)
-			bndbox <- changeExtent(object, xmx=xmx, ymn=ymn)
-			object <- setExtent(sampraster, bndbox, keepres=FALSE)
+			xmax(sampraster) <- xmax(object) - (ncol(object) - cols[length(cols)]) * xres(object)
+			ymin(sampraster) <- ymin(object) + (nrow(object) - rows[length(rows)]) * yres(object)
+			object <- sampraster
  		} else { 
 			m <- values(object, format='matrix')
 			subsample=FALSE

Modified: pkg/raster/R/readSkip.R
===================================================================
--- pkg/raster/R/readSkip.R	2009-04-18 03:22:58 UTC (rev 412)
+++ pkg/raster/R/readSkip.R	2009-04-18 05:08:58 UTC (rev 413)
@@ -48,10 +48,8 @@
 		}	
 		outras <- raster(raster)
 		outras <- setRowCol(outras, nr, nc)
-		xmx <- xmax(raster) - (ncol(raster) - cols[nc]) * xres(raster)
-		ymn <- ymin(raster) + (nrow(raster) - row) * yres(raster)
-		bndbox <- changeExtent(raster, xmx=xmx, ymn=ymn)
-		outras <- setExtent(outras, bndbox, keepres=FALSE)
+		xmax(outras) <- xmax(raster) - (ncol(raster) - cols[nc]) * xres(raster)
+		ymin(outras) <- ymin(raster) + (nrow(raster) - row) * yres(raster)
 		outras <- setValues(outras, dd)
 	}
 	if (asRaster) {

Modified: pkg/raster/R/reclass.R
===================================================================
--- pkg/raster/R/reclass.R	2009-04-18 03:22:58 UTC (rev 412)
+++ pkg/raster/R/reclass.R	2009-04-18 05:08:58 UTC (rev 413)
@@ -55,7 +55,7 @@
 				if (is.na(rclmat[i,1]) | is.na(rclmat[i,2])) {
 					res[ is.na(values(raster)) ] <- rclmat[i, 3] 
 				} else {
-					res[ (values(raster) > rclmat[i,1]) & (values(raster) <= rclmat[i,2]) ] <- rclmat[i , 3] 
+					res[ (values(raster) >= rclmat[i,1]) & (values(raster) <= rclmat[i,2]) ] <- rclmat[i , 3] 
 				}
 			}	
 			outraster <- setValues(outraster, res, r)

Modified: pkg/raster/R/replaceProperties.R
===================================================================
--- pkg/raster/R/replaceProperties.R	2009-04-18 03:22:58 UTC (rev 412)
+++ pkg/raster/R/replaceProperties.R	2009-04-18 05:08:58 UTC (rev 413)
@@ -23,18 +23,22 @@
 }
 
 'xmin<-' <- function(x, value) {
-	return(changeExtent(x, xmn=value))
+	x at bbox@xmin <- value
+	return(x)
 }
 
 'xmax<-' <- function(x, value) {
-	return(changeExtent(x, xmx=value))
+	x at bbox@xmax <- value
+	return(x)
 }
 
 'ymin<-' <- function(x, value) {
-	return(changeExtent(x, ymn=value))
+	x at bbox@ymin <- value
+	return(x)
 }
 
 'ymax<-' <- function(x, value) {
-	return(changeExtent(x, ymx=value))
+	x at bbox@ymax <- value
+	return(x)
 }
 

Modified: pkg/raster/R/set.R
===================================================================
--- pkg/raster/R/set.R	2009-04-18 03:22:58 UTC (rev 412)
+++ pkg/raster/R/set.R	2009-04-18 05:08:58 UTC (rev 413)
@@ -40,3 +40,7 @@
 	x at file@nodatavalue <- value
 	return(x)
 }
+
+'NAvalue' <- function(x, value) {
+	return(x at file@nodatavalue)
+}

Deleted: pkg/raster/R/setBbox.R
===================================================================
--- pkg/raster/R/setBbox.R	2009-04-18 03:22:58 UTC (rev 412)
+++ pkg/raster/R/setBbox.R	2009-04-18 05:08:58 UTC (rev 413)
@@ -1,55 +0,0 @@
-# R function for the raster package
-# Author: Robert J. Hijmans
-# International Rice Research Institute. Philippines
-# contact: r.hijmans at gmail.com
-# Date : January 2009
-# Version 0.8
-# Licence GPL v3
-
-
-setExtent <- function(x, bndbox, keepres=FALSE, snap=FALSE) {
-
-	oldbb <- extent(x)
-	bb <- extent(bndbox)
-	newobj <- clearValues(x)
-	
-	if (snap) {
-		bb <- alignBbox(bb, newobj)
-	}
-
-	newobj at bbox <- bb
-	
-	if (keepres) {
-		xrs <- xres(x)
-		yrs <- yres(x)
-		nc <- as.integer(round( (xmax(newobj) - xmin(newobj)) / xrs ))
-		if (nc < 1) { stop( "xmin and xmax are less than one cell apart" ) 
-		} else { newobj at ncols <- nc }
-		nr <- as.integer(round( (ymax(newobj) - ymin(newobj)) / yrs ) )
-		if (nr < 1) { stop( "ymin and ymax are less than one cell apart" )
-		} else { newobj at nrows <- nr }
-		newobj at bbox@xmax <- newobj at bbox@xmin + ncol(newobj) * xrs
-		newobj at bbox@ymax <- newobj at bbox@ymin + nrow(newobj) * yrs
-		
-		if (dataContent(x) == 'all') {
-			if (ncol(x) == ncol(newobj) & nrow(x) == nrow(newobj)) {
-				newobj <- setValues(newobj, values(x))
-			} else {
-				newobj at data@source <- 'ram'
-				indices <- cellsFromBbox(x, bb, expand=TRUE)
-				v <- vector(length=length(indices))
-				v[] <- NA
-				v[!is.na(indices)] <- values(x)[!is.na(indices)]
-				newobj <- setValues(newobj, v)
-			}
-		}
-		
-	} else if (class(x) != "BasicRaster") {
-		if (ncol(x)==ncol(newobj) & nrow(x)==nrow(newobj))  {
-			if (dataContent(x) == 'all') {
-				newobj <- setValues(newobj, values(x))
-			}	
-		}
-	}
-	return(newobj)
-}

Added: pkg/raster/R/setExtent.R
===================================================================
--- pkg/raster/R/setExtent.R	                        (rev 0)
+++ pkg/raster/R/setExtent.R	2009-04-18 05:08:58 UTC (rev 413)
@@ -0,0 +1,56 @@
+# R function for the raster package
+# Author: Robert J. Hijmans
+# International Rice Research Institute. Philippines
+# contact: r.hijmans at gmail.com
+# Date : January 2009
+# Version 0.8
+# Licence GPL v3
+
+
+
+setExtent <- function(x, bndbox, keepres=FALSE, snap=FALSE) {
+
+	oldbb <- extent(x)
+	bb <- extent(bndbox)
+	newobj <- clearValues(x)
+	
+	if (snap) {
+		bb <- alignBbox(bb, newobj)
+	}
+
+	newobj at bbox <- bb
+	
+	if (keepres) {
+		xrs <- xres(x)
+		yrs <- yres(x)
+		nc <- as.integer(round( (xmax(newobj) - xmin(newobj)) / xrs ))
+		if (nc < 1) { stop( "xmin and xmax are less than one cell apart" ) 
+		} else { newobj at ncols <- nc }
+		nr <- as.integer(round( (ymax(newobj) - ymin(newobj)) / yrs ) )
+		if (nr < 1) { stop( "ymin and ymax are less than one cell apart" )
+		} else { newobj at nrows <- nr }
+		newobj at bbox@xmax <- newobj at bbox@xmin + ncol(newobj) * xrs
+		newobj at bbox@ymax <- newobj at bbox@ymin + nrow(newobj) * yrs
+		
+		if (dataContent(x) == 'all') {
+			if (ncol(x) == ncol(newobj) & nrow(x) == nrow(newobj)) {
+				newobj <- setValues(newobj, values(x))
+			} else {
+				newobj at data@source <- 'ram'
+				indices <- cellsFromBbox(x, bb, expand=TRUE)
+				v <- vector(length=length(indices))
+				v[] <- NA
+				v[!is.na(indices)] <- values(x)[!is.na(indices)]
+				newobj <- setValues(newobj, v)
+			}
+		}
+		
+	} else if (class(x) != "BasicRaster") {
+		if (ncol(x)==ncol(newobj) & nrow(x)==nrow(newobj))  {
+			if (dataContent(x) == 'all') {
+				newobj <- setValues(newobj, values(x))
+			}	
+		}
+	}
+	return(newobj)
+}

Added: pkg/raster/R/shift.R
===================================================================
--- pkg/raster/R/shift.R	                        (rev 0)
+++ pkg/raster/R/shift.R	2009-04-18 05:08:58 UTC (rev 413)
@@ -0,0 +1,17 @@
+# R function for the raster package
+# Author: Robert J. Hijmans
+# International Rice Research Institute. Philippines
+# contact: r.hijmans at gmail.com
+# Date : January 2009
+# Version 0.8
+# Licence GPL v3
+
+
+
+shift <- function(object, x=0, y=0) {
+	object at bbox@xmin <- object at bbox@xmin + x
+	object at bbox@ymin <- object at bbox@ymin + y
+	object at bbox@xmax <- object at bbox@xmax + x
+	object at bbox@ymax <- object at bbox@ymax + y
+	return(object)
+}

Modified: pkg/raster/man/LinesToRaster.Rd
===================================================================
--- pkg/raster/man/LinesToRaster.Rd	2009-04-18 03:22:58 UTC (rev 412)
+++ pkg/raster/man/LinesToRaster.Rd	2009-04-18 05:08:58 UTC (rev 413)
@@ -21,7 +21,7 @@
   \item{updateRaster}{logical. If \code{TRUE} the values of the input RasterLayer are updated where the polygons overlap cells  }
   \item{updateValue}{character. Select cells to be updated (if \code{updateRaster == TRUE}) by their current values. Either 'all', 'NA', '!NA', or 'zero' } 
   \item{filetype}{output file type. Either 'raster', 'ascii' or a supported GDAL 'driver' name see \code{\link[raster]{writeRaster}}}
-  \item{datatype}{output data type; see \code{\link[raster]{setDatatype}}}
+  \item{datatype}{output data type; see \code{\link[raster]{dataType}}}
   \item{track}{vector of row numbers for which the function will report that they have been processed}    
 }
 

Modified: pkg/raster/man/PolygonsToRaster.Rd
===================================================================
--- pkg/raster/man/PolygonsToRaster.Rd	2009-04-18 03:22:58 UTC (rev 412)
+++ pkg/raster/man/PolygonsToRaster.Rd	2009-04-18 05:08:58 UTC (rev 413)
@@ -23,7 +23,7 @@
   \item{updateRaster}{logical. If \code{TRUE} the values of the input RasterLayer are updated where the polygons overlap cells  }
   \item{updateValue}{character. Select cells to be updated (if \code{updateRaster == TRUE}) by their current values. Either \code{'all'}, \code{'NA'}, \code{'!NA'}, or \code{'zero'} } 
   \item{filetype}{output file type. Either 'raster', 'ascii' or a supported GDAL 'driver' name see \code{\link[raster]{writeRaster}}}
-  \item{datatype}{output data type; see \code{\link[raster]{setDatatype}}}
+  \item{datatype}{output data type; see \code{\link[raster]{dataType}}}
   \item{track}{vector of row numbers for which the function will report that they have been processed. To track progress on very large files }
 }
 

Modified: pkg/raster/man/aggregate.Rd
===================================================================
--- pkg/raster/man/aggregate.Rd	2009-04-18 03:22:58 UTC (rev 412)
+++ pkg/raster/man/aggregate.Rd	2009-04-18 05:08:58 UTC (rev 413)
@@ -39,7 +39,7 @@
 \tab \code{filename} \tab character. output filename \cr
 \tab \code{overwrite} \tab logical. If \code{TRUE}, "filename" will be overwritten if it exists \cr
 \tab \code{filetype} \tab character. output file type. Either 'raster', 'ascii' or a supported GDAL 'driver' name see \code{\link[raster]{rasterFormats}} \cr
-\tab \code{datatype} \tab character. output data type; see \code{\link[raster]{setDatatype}} \cr
+\tab \code{datatype} \tab character. output data type; see \code{\link[raster]{dataType}} \cr
 \tab \code{track} \tab vector of row numbers for which the function will report that they have been processed \cr
 }
 

Modified: pkg/raster/man/calc.Rd
===================================================================
--- pkg/raster/man/calc.Rd	2009-04-18 03:22:58 UTC (rev 412)
+++ pkg/raster/man/calc.Rd	2009-04-18 05:08:58 UTC (rev 413)
@@ -37,7 +37,7 @@
   \tab  \code{filename}  \tab Output filename for a new raster; if NA the result is not written to a file but returned with the RasterLayer object, in the data slot \cr
   \tab  \code{overwrite}  \tab Logical to indicate whether an existing output file should be overwritten \cr
   \tab  \code{filetype}  \tab output file type. Either 'raster', 'ascii' or a supported GDAL 'driver' name see \code{\link[raster]{writeRaster}} \cr
-  \tab  \code{datatype}  \tab output data type; see \code{\link[raster]{setDatatype}} \cr
+  \tab  \code{datatype}  \tab output data type; see \code{\link[raster]{dataType}} \cr
   \tab  \code{track}  \tab vector of row numbers for which the function will report that they have been processed \cr
 }
 

Deleted: pkg/raster/man/changeExtent.Rd
===================================================================
--- pkg/raster/man/changeExtent.Rd	2009-04-18 03:22:58 UTC (rev 412)
+++ pkg/raster/man/changeExtent.Rd	2009-04-18 05:08:58 UTC (rev 413)
@@ -1,43 +0,0 @@
-\name{changeExtent}
-
-\alias{changeExtent}
-  
-\title{Change the extent of a RasteLayer}
-
-\description{
-
-changeExtent changes the extent (the bounding box) of a Raster* object
-
-the extent can also be changed by assignment functions (e.g. \code{xmin(x) <- -180}).
-}
-
-\usage{
-changeExtent(x, xmn=xmin(x), xmx=xmax(x), ymn=ymin(x), ymx = ymax(x), keepres=FALSE) 
-}
-
-\arguments{
-  \item{x}{A Raster* object}
-  \item{keepres}{logical. If \code{TRUE}, the resolution of the cells will stay the same after adjusting the bounding box (by adjusting the number of rows and columns). if \code{FALSE}, the number of rows and columns will stay the same, and the resolution will be adjusted}
-  \item{xmn}{the minimum x coordinate of the object}
-  \item{xmx}{the maximum x coordinate of the object}
-  \item{ymn}{the minimum y coordinate of the object}
-  \item{ymx}{the maximum y coordinate of the object}
-  
-}
- 
-\value{
-a Raster* object
-}
-  
-\author{Robert J. Hijmans}
-
-\seealso{ \code{\link[raster]{setExtent}}, \code{\link[raster]{BoungingBox-class}} }
-
-\examples{
-r <- raster()
-r <- changeExtent(r, xmn=1, xmx=50)
-xmin(r) <- -30
-ymax(r) <- 60
-}
-
-\keyword{spatial}

Added: pkg/raster/man/coordinates.Rd
===================================================================
--- pkg/raster/man/coordinates.Rd	                        (rev 0)
+++ pkg/raster/man/coordinates.Rd	2009-04-18 05:08:58 UTC (rev 413)
@@ -0,0 +1,59 @@
+\name{coordinates}
+
+\alias{xmin}
+\alias{xmax}
+\alias{ymin}
+\alias{ymax}
+\alias{xmin<-}
+\alias{xmax<-}
+\alias{ymin<-}
+\alias{ymax<-}
+
+  
+\title{Coordinates}
+
+\description{
+These functions return or set the extreme coordinates of a Raster* object. 
+}
+
+\usage{
+xmin(object)
+xmax(object)
+ymin(object)
+ymax(object)
+
+xmin(x) <- value
+xmax(x) <- value
+ymin(x) <- value
+ymax(x) <- value
+
+}
+
+\arguments{
+  \item{object}{A Raster* object}
+  \item{x}{A Raster* object}
+  \item{value}{A new x or y coordinate}  
+}
+
+
+\value{
+a single number
+}
+
+\seealso{ \code{\link[raster]{setExtent}},  \code{\link[raster]{dimensions}} }
+
+
+\author{Robert J. Hijmans }
+
+\examples{
+
+r <- raster(xmn=-0.5, xmx = 9.5, ncols=10)
+xmin(r)
+xmax(r)
+ymin(r)
+ymax(r)
+xmin(r) <- -180
+xmax(r) <- 180
+}
+
+\keyword{spatial}

Modified: pkg/raster/man/crop.Rd
===================================================================
--- pkg/raster/man/crop.Rd	2009-04-18 03:22:58 UTC (rev 412)
+++ pkg/raster/man/crop.Rd	2009-04-18 05:08:58 UTC (rev 413)
@@ -9,16 +9,17 @@
 }
 
 \usage{
-crop(raster, bndbox, filename="", overwrite=FALSE, filetype='raster', track=-1) 
+crop(raster, bndbox, filename="", overwrite=FALSE, filetype='raster', datatype=dataType(raster), track=-1) 
 }
 
 \arguments{
-  \item{raster}{a RasterLayer object}
+  \item{raster}{A RasterLayer object}
   \item{bndbox}{BoundingBox object, or any object that is or has a bounding box (see below)}
-  \item{filename}{character. Output filename for a new raster}
-  \item{overwrite}{if \code{TRUE}, the file will be overwritten if it exists}
-  \item{filetype}{output file type. Either 'raster', 'ascii' or a supported GDAL format see \code{\link[raster]{writeRaster}}}
-  \item{track}{vector of row numbers for which the function will report that they have been processed}  
+  \item{filename}{Character. Output filename for a new raster}
+  \item{overwrite}{If \code{TRUE}, the file will be overwritten if it exists}
+  \item{filetype}{Output file type. Either 'raster', 'ascii' or a supported GDAL format see \code{\link[raster]{writeRaster}}}
+  \item{datatype}{Output data type; see \code{\link[raster]{dataType}}}
+  \item{track}{Vector of row numbers for which the function will report that they have been processed}  
 }
 
 \details{

Modified: pkg/raster/man/disaggregate.Rd
===================================================================
--- pkg/raster/man/disaggregate.Rd	2009-04-18 03:22:58 UTC (rev 412)
+++ pkg/raster/man/disaggregate.Rd	2009-04-18 05:08:58 UTC (rev 413)
@@ -17,7 +17,7 @@
   \item{fact}{degree of aggregation or disaggregation expressed as number of cells (horizontally and vertically). See details}
   \item{overwrite}{if TRUE, "filename" will be overwritten if it exists}
   \item{filetype}{output file type. Either 'raster', 'ascii' or a supported GDAL 'driver' name see \code{\link[raster]{writeRaster}}}
-  \item{datatype}{output data type; see \code{\link[raster]{setDatatype}}}
+  \item{datatype}{output data type; see \code{\link[raster]{dataType}}}
   \item{track}{vector of row numbers for which the function will report that they have been processed}   
 }
 

Modified: pkg/raster/man/distance.Rd
===================================================================
--- pkg/raster/man/distance.Rd	2009-04-18 03:22:58 UTC (rev 412)
+++ pkg/raster/man/distance.Rd	2009-04-18 05:08:58 UTC (rev 413)
@@ -25,7 +25,7 @@
 \item{filename}{character. output filename}
 \item{overwrite}{logical. If \code{TRUE}, "filename" will be overwritten if it exists}
 \item{filetype}{character. output file type. Either 'raster', 'ascii' or a supported GDAL 'driver' name see \code{\link[raster]{rasterFormats}}}
-\item{datatype}{character. output data type; see \code{\link[raster]{setDatatype}}}
+\item{datatype}{character. output data type; see \code{\link[raster]{dataType}}}
 \item{track}{vector of row numbers for which the function will report that they have been processed}
 }
 

Deleted: pkg/raster/man/extent.Rd
===================================================================
--- pkg/raster/man/extent.Rd	2009-04-18 03:22:58 UTC (rev 412)
+++ pkg/raster/man/extent.Rd	2009-04-18 05:08:58 UTC (rev 413)
@@ -1,59 +0,0 @@
-\name{coordinates}
-
-\alias{xmin}
-\alias{xmax}
-\alias{ymin}
-\alias{ymax}
-\alias{xmin<-}
-\alias{xmax<-}
-\alias{ymin<-}
-\alias{ymax<-}
-
-  
-\title{Coordinates}
-
-\description{
-These functions return or set the extreme coordinates of a Raster* object. 
-}
-
-\usage{
-xmin(object)
-xmax(object)
-ymin(object)
-ymax(object)
-
-xmin(x) <- value
-xmax(x) <- value
-ymin(x) <- value
-ymax(x) <- value
-
-}
-
-\arguments{
-  \item{object}{A Raster* object}
-  \item{x}{A Raster* object}
-  \item{value}{A new x or y coordinate}  
-}
-
-
-\value{
-a single number
-}
-
-\seealso{ \code{\link[raster]{setExtent}},  \code{\link[raster]{dimensions}} }
-
-
-\author{Robert J. Hijmans }
-
-\examples{
-
-r <- raster(xmn=-0.5, xmx = 9.5, ncols=10)
-xmin(r)
-xmax(r)
-ymin(r)
-ymax(r)
-xmin(r) <- -180
-xmax(r) <- 180
-}
-
-\keyword{spatial}

Modified: pkg/raster/man/focal.Rd
===================================================================
--- pkg/raster/man/focal.Rd	2009-04-18 03:22:58 UTC (rev 412)
+++ pkg/raster/man/focal.Rd	2009-04-18 05:08:58 UTC (rev 413)
@@ -20,7 +20,7 @@
   \item{keepdata}{Logical. If \code{TRUE}, NA will be removed for neighborhood computations. The result will only be NA if all cells are NA}
   \item{overwrite}{Logical to indicate whether an existing output file should be overwritten}
   \item{filetype}{output file type. Either 'raster', 'ascii' or a supported GDAL 'driver' name see \code{\link[raster]{writeRaster}}}
-  \item{datatype}{output data type; see \code{\link[raster]{setDatatype}}}
+  \item{datatype}{output data type; see \code{\link[raster]{dataType}}}
   \item{track}{vector of row numbers for which the function will report that they have been processed}   
 }
 

Modified: pkg/raster/man/focalFilter.Rd
===================================================================
--- pkg/raster/man/focalFilter.Rd	2009-04-18 03:22:58 UTC (rev 412)
+++ pkg/raster/man/focalFilter.Rd	2009-04-18 05:08:58 UTC (rev 413)
@@ -19,7 +19,7 @@
   \item{filename}{Output filename for a new raster}
   \item{overwrite}{Logical to indicate whether an existing output file should be overwritten}
   \item{filetype}{output file type. Either 'raster', 'ascii' or a supported GDAL 'driver' name see \code{\link[raster]{writeRaster}}}
-  \item{datatype}{output data type; see \code{\link[raster]{setDatatype}}}
+  \item{datatype}{output data type; see \code{\link[raster]{dataType}}}
   \item{track}{vector of row numbers for which the function will report that they have been processed}   
 }
 

Modified: pkg/raster/man/init.Rd
===================================================================
--- pkg/raster/man/init.Rd	2009-04-18 03:22:58 UTC (rev 412)
+++ pkg/raster/man/init.Rd	2009-04-18 05:08:58 UTC (rev 413)
@@ -18,7 +18,7 @@
   \item{filename}{Output filename for a new raster; if NA the result is not written to a file but returned with the RasterLayer object, in the data slot}
   \item{overwrite}{Logical. if \code{TRUE}, the file will be overwritten if it exists}
   \item{filetype}{output file type. Either 'raster', 'ascii' or a supported GDAL 'driver' name see \code{\link[raster]{writeRaster}}}
-  \item{datatype}{output data type; see \code{\link[raster]{setDatatype}}}
+  \item{datatype}{output data type; see \code{\link[raster]{dataType}}}
   \item{track}{vector of row numbers for which the function will report that they have been processed}  
 }
 

Modified: pkg/raster/man/merge.Rd
===================================================================
--- pkg/raster/man/merge.Rd	2009-04-18 03:22:58 UTC (rev 412)
+++ pkg/raster/man/merge.Rd	2009-04-18 05:08:58 UTC (rev 413)
@@ -38,7 +38,7 @@
   \item{\code{filename}}{character. output filename}
   \item{\code{overwrite}}{logical. If \code{TRUE}, "filename" will be overwritten if it exists}
   \item{\code{filetype}}{character. output file type. Either 'raster', 'ascii' or a supported GDAL 'driver' name see \code{\link[raster]{rasterFormats}}}
-  \item{\code{datatype}}{character. output data type; see \code{\link[raster]{setDatatype}}}
+  \item{\code{datatype}}{character. output data type; see \code{\link[raster]{dataType}}}
   \item{\code{track}}{vector of row numbers for which the function will report that they have been processed}   
 }  
   

Modified: pkg/raster/man/pointsToRaster.Rd
===================================================================
--- pkg/raster/man/pointsToRaster.Rd	2009-04-18 03:22:58 UTC (rev 412)
+++ pkg/raster/man/pointsToRaster.Rd	2009-04-18 05:08:58 UTC (rev 413)
@@ -19,7 +19,7 @@
   \item{filename}{ output filename }
   \item{overwrite}{if \code{TRUE}, the file will be overwritten if it exists}  
   \item{filetype}{output file type. Either 'raster', 'ascii' or a supported GDAL 'driver' name see \code{\link[raster]{writeRaster}}}
-  \item{datatype}{output data type; see \code{\link[raster]{setDatatype}}}
+  \item{datatype}{output data type; see \code{\link[raster]{dataType}}}
   \item{track}{vector of row numbers for which the function will report that they have been processed}    
   
 }

Modified: pkg/raster/man/project.Rd
===================================================================
--- pkg/raster/man/project.Rd	2009-04-18 03:22:58 UTC (rev 412)
+++ pkg/raster/man/project.Rd	2009-04-18 05:08:58 UTC (rev 413)
@@ -21,7 +21,7 @@
   \item{filename}{character. output filename}  
   \item{overwrite}{Logical. If \code{TRUE}, the output file is overwritten if it already exists}
   \item{filetype}{output file type. Either 'raster', 'ascii' or a supported GDAL 'driver' name see \code{\link[raster]{writeRaster}}}
-  \item{datatype}{output data type; see \code{\link[raster]{setDatatype}}}
+  \item{datatype}{output data type; see \code{\link[raster]{dataType}}}
   \item{track}{vector of row numbers for which the function will report that they have been processed}  
   \item{object}{BoundingBox or Raster* object}
   \item{projs}{a character string describing a projection and datum in PROJ4 format}

Modified: pkg/raster/man/reclass.Rd
===================================================================
--- pkg/raster/man/reclass.Rd	2009-04-18 03:22:58 UTC (rev 412)
+++ pkg/raster/man/reclass.Rd	2009-04-18 05:08:58 UTC (rev 413)
@@ -17,7 +17,7 @@
   \item{filename}{Output filename for a new raster; if NA the result is not written to a file but returned with the RasterLayer object, in the data slot}
   \item{overwrite}{Logical to indicate whether an existing output file should be overwritten}
   \item{filetype}{output file type. Either 'raster', 'ascii' or a supported GDAL 'driver' name see \code{\link[raster]{writeRaster}}}
-  \item{datatype}{output data type; see \code{\link[raster]{setDatatype}}}
+  \item{datatype}{output data type; see \code{\link[raster]{dataType}}}
   \item{track}{vector of row numbers for which the function will report that they have been processed}   
 }
 
@@ -25,7 +25,7 @@
 \code{reclass} reclassifies groups of values to other values. E.g. All values between 1 and 10 become 1, and between 11 and 15 become 2. 
 Reclassification is done with matrix "rclmat". This matrix must have 3 columns. 
 The first two columns are "from" "to" of the input values, and the third column has the new value for that range.
-A reclass is applied to  \code{from < x <= to}, so make sure you include a start value below the lowest value
+A reclass is applied to  \code{from <= x <= to}, in the order that they are in the reclass table.  
 
 You can also supply a vector that can be coecred into a n*3 matrix
 	
@@ -44,7 +44,7 @@
 r <- raster(ncols=36, nrows=18)
 r[] <- runif(ncell(r)) 
 # reclassify the values into three groups 
-# all values between > 0 and <= 0.25 become 1, etc.
+# all values >= 0 and <= 0.25 become 1, etc.
 m <- c(0, 0.25, 1,  0.25, 0.5, 2,  0.5, 1, 3)
 rclmat <- matrix(m, ncol=3, byrow=TRUE)
 rc <- reclass(r, rclmat)

Modified: pkg/raster/man/resample.Rd
===================================================================
--- pkg/raster/man/resample.Rd	2009-04-18 03:22:58 UTC (rev 412)
+++ pkg/raster/man/resample.Rd	2009-04-18 05:08:58 UTC (rev 413)
@@ -21,7 +21,7 @@
   \item{filename}{character. output filename}  
   \item{overwrite}{logical. If \code{TRUE}, the output file is overwritten if it already exists}
   \item{filetype}{output file type. Either 'raster', 'ascii' or a supported GDAL 'driver' name see \code{\link[raster]{writeRaster}}}
-  \item{datatype}{output data type; see \code{\link[raster]{setDatatype}}}
+  \item{datatype}{output data type; see \code{\link[raster]{dataType}}}
   \item{track}{vector of row numbers for which the function will report that they have been processed}  
 }
 

Modified: pkg/raster/man/setDatatype.Rd
===================================================================
--- pkg/raster/man/setDatatype.Rd	2009-04-18 03:22:58 UTC (rev 412)
+++ pkg/raster/man/setDatatype.Rd	2009-04-18 05:08:58 UTC (rev 413)
@@ -1,4 +1,4 @@
-\name{setDatatype}
+\name{dataType}
 
 \alias{dataType<-}
 \alias{dataType}

Modified: pkg/raster/man/setExtent.Rd
===================================================================
--- pkg/raster/man/setExtent.Rd	2009-04-18 03:22:58 UTC (rev 412)
+++ pkg/raster/man/setExtent.Rd	2009-04-18 05:08:58 UTC (rev 413)
@@ -34,7 +34,7 @@
   
 \author{Robert J. Hijmans}
 
-\seealso{ \code{\link[raster]{changeExtent}}, \code{\link[raster]{BoungingBox-class}} }
+\seealso{ \code{\link[raster]{BoungingBox-class}} }
 
 \examples{
 r <- raster()

Modified: pkg/raster/man/setNAvalue.Rd
===================================================================
--- pkg/raster/man/setNAvalue.Rd	2009-04-18 03:22:58 UTC (rev 412)
+++ pkg/raster/man/setNAvalue.Rd	2009-04-18 05:08:58 UTC (rev 413)
@@ -1,10 +1,12 @@
-\name{setNAvalue}
+\name{NAvalue}
 
 \alias{NAvalue<-}
+\alias{NAvalue}
 
 \title{set the NA value of a RasterLayer }
 
 \description{
+NAvalue returns the value that is used to write NA values to disk (in 'raster' type files). 
 If you set the NA value of a RasterLayer, this value will be interpreted as NA when reading the values from a file. 
 Values already in memory will not be affected. 
 
@@ -31,6 +33,7 @@
 \examples{ 
 r1 <- raster(system.file("pictures/Rlogo.jpg", package="rgdal"))
 r2 <- r1
+NAvalue(r2)
 NAvalue(r2) <- 255
 #plot(r1)
 #x11()

Modified: pkg/raster/man/writeStack.Rd
===================================================================
--- pkg/raster/man/writeStack.Rd	2009-04-18 03:22:58 UTC (rev 412)
+++ pkg/raster/man/writeStack.Rd	2009-04-18 05:08:58 UTC (rev 413)
@@ -21,7 +21,7 @@
   \item{filename}{character. output filename}
   \item{overwrite}{logical. If \code{TRUE}, "filename" will be overwritten if it exists}
 \item{filetype}{character. output file type. Either 'raster', 'ascii' or a supported GDAL 'driver' name see \code{\link[raster]{rasterFormats}}}
-\item{datatype}{character. output data type; see \code{\link[raster]{setDatatype}}}
+\item{datatype}{character. output data type; see \code{\link[raster]{dataType}}}
 }
 
 \details{



More information about the Raster-commits mailing list