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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun May 3 04:53:36 CEST 2009


Author: rhijmans
Date: 2009-05-03 04:53:35 +0200 (Sun, 03 May 2009)
New Revision: 441

Modified:
   pkg/raster/R/Artith.R
   pkg/raster/R/Math.R
   pkg/raster/R/Merge.R
   pkg/raster/R/aggold.R
   pkg/raster/R/aggregate.R
   pkg/raster/R/canProcessInMemory.R
   pkg/raster/R/cover.R
   pkg/raster/R/crop.R
   pkg/raster/R/disaggregate.R
   pkg/raster/R/expand.R
   pkg/raster/R/project.R
   pkg/raster/R/rasterTmpFile.R
   pkg/raster/R/readBlock.R
   pkg/raster/R/readRows.R
   pkg/raster/R/reclass.R
   pkg/raster/R/resample.R
   pkg/raster/man/tmpDir.Rd
Log:


Modified: pkg/raster/R/Artith.R
===================================================================
--- pkg/raster/R/Artith.R	2009-05-03 02:37:41 UTC (rev 440)
+++ pkg/raster/R/Artith.R	2009-05-03 02:53:35 UTC (rev 441)
@@ -17,7 +17,7 @@
 					raster <- setValues(raster, callGeneric( as.numeric(.getRowValues(e1, r)), .getRowValues(e2, r) ), r)
 					raster <- writeRaster(raster)
 				}
-				if (options('verbose')[[1]]) {
+				if (getOption('verbose')) {
 					cat('values were written to:', raster at file@name)
 				}
 			}	
@@ -37,7 +37,7 @@
 				raster <- setValues(raster, callGeneric( as.numeric(.getRowValues(e1, r)), e2) , r) 
 				raster <- writeRaster(raster)
 			}
-			if (options('verbose')[[1]]) {
+			if (getOption('verbose')) {
 				cat('values were written to:', filename(raster))
 			}			
 			return(raster)
@@ -55,7 +55,7 @@
 				raster <- setValues(raster, callGeneric(as.numeric(e1), .getRowValues(e2, r)) , r)
 				raster <- writeRaster(raster)
 			}
-			if (options('verbose')[[1]]) {
+			if (getOption('verbose')) {
 				cat('values were written to:', filename(raster))
 			}
 			return(raster)

Modified: pkg/raster/R/Math.R
===================================================================
--- pkg/raster/R/Math.R	2009-05-03 02:37:41 UTC (rev 440)
+++ pkg/raster/R/Math.R	2009-05-03 02:53:35 UTC (rev 441)
@@ -24,7 +24,7 @@
 				rst <- setValues(rst, callGeneric( .getRowValues(x, r) ), r)
 				rst <- writeRaster(rst)
 			}
-			if (options('verbose')[[1]]) {
+			if (getOption('verbose')) {
 				cat('values were written to:', filename(raster))
 			}
 		}

Modified: pkg/raster/R/Merge.R
===================================================================
--- pkg/raster/R/Merge.R	2009-05-03 02:37:41 UTC (rev 440)
+++ pkg/raster/R/Merge.R	2009-05-03 02:53:35 UTC (rev 441)
@@ -51,7 +51,7 @@
 	if (!canProcessInMemory(x, 2) && filename == '') {
 		filename <- rasterTmpFile()
 		filename(outraster) <- filename
-		if (options('verbose')[[1]]) { cat('writing raster to:', filename(raster))	}						
+		if (getOption('verbose')) { cat('writing raster to:', filename(raster))	}						
 	}
 
 	starttime <- proc.time()

Modified: pkg/raster/R/aggold.R
===================================================================
--- pkg/raster/R/aggold.R	2009-05-03 02:37:41 UTC (rev 440)
+++ pkg/raster/R/aggold.R	2009-05-03 02:53:35 UTC (rev 441)
@@ -73,7 +73,7 @@
 		if (!canProcessInMemory(x, 2) && filename == '') {
 			filename <- rasterTmpFile()
 			filename(outraster) <- filename
-			if (options('verbose')[[1]]) { cat('writing raster to:', filename(raster))	}						
+			if (getOption('verbose')) { cat('writing raster to:', filename(raster))	}						
 		}
 		starttime <- proc.time()
 		

Modified: pkg/raster/R/aggregate.R
===================================================================
--- pkg/raster/R/aggregate.R	2009-05-03 02:37:41 UTC (rev 440)
+++ pkg/raster/R/aggregate.R	2009-05-03 02:53:35 UTC (rev 441)
@@ -82,7 +82,7 @@
 		if (!canProcessInMemory(x, 2) && filename == '') {
 			filename <- rasterTmpFile()
 			filename(outRaster) <- filename
-			if (options('verbose')[[1]]) { cat('writing raster to:', filename(outRaster))	}						
+			if (getOption('verbose')) { cat('writing raster to:', filename(outRaster))	}						
 		}
 		starttime <- proc.time()
 		v <- vector(length=0)

Modified: pkg/raster/R/canProcessInMemory.R
===================================================================
--- pkg/raster/R/canProcessInMemory.R	2009-05-03 02:37:41 UTC (rev 440)
+++ pkg/raster/R/canProcessInMemory.R	2009-05-03 02:53:35 UTC (rev 441)
@@ -22,7 +22,7 @@
 			return(TRUE)
 		}
 	} else {
-		w <- options('warn')[[1]]
+		w <- getOption('warn')
 		options('warn'=-1) 
 		r <- try( matrix(NA, ncol=n, nrow=cells), silent=TRUE )
 		options('warn'= w) 

Modified: pkg/raster/R/cover.R
===================================================================
--- pkg/raster/R/cover.R	2009-05-03 02:37:41 UTC (rev 440)
+++ pkg/raster/R/cover.R	2009-05-03 02:53:35 UTC (rev 441)
@@ -38,7 +38,7 @@
 		if (!canProcessInMemory(x, 4) && filename == '') {
 			filename <- rasterTmpFile()
 			filename(outraster) <- filename
-			if (options('verbose')[[1]]) { cat('writing raster to:', filename(raster))	}						
+			if (getOption('verbose')) { cat('writing raster to:', filename(raster))	}						
 		}
 		starttime <- proc.time()
 

Modified: pkg/raster/R/crop.R
===================================================================
--- pkg/raster/R/crop.R	2009-05-03 02:37:41 UTC (rev 440)
+++ pkg/raster/R/crop.R	2009-05-03 02:53:35 UTC (rev 441)
@@ -33,7 +33,7 @@
 		if (!canProcessInMemory(outraster, 2) && filename == '') {
 			filename <- rasterTmpFile()
 			filename(outraster) <- filename
-			if (options('verbose')[[1]]) { cat('writing raster to:', filename(outraster))	}						
+			if (getOption('verbose')) { cat('writing raster to:', filename(outraster))	}						
 		}
 		
 		starttime <- proc.time()

Modified: pkg/raster/R/disaggregate.R
===================================================================
--- pkg/raster/R/disaggregate.R	2009-05-03 02:37:41 UTC (rev 440)
+++ pkg/raster/R/disaggregate.R	2009-05-03 02:53:35 UTC (rev 441)
@@ -30,7 +30,7 @@
 	
 	if (!canProcessInMemory(outraster, 3) && filename == '') {
 		filename <- rasterTmpFile()
-		if (options('verbose')[[1]]) { cat('writing raster to:', filename)	}						
+		if (getOption('verbose')) { cat('writing raster to:', filename)	}						
 	}
 	filename(outraster) <- filename
 	

Modified: pkg/raster/R/expand.R
===================================================================
--- pkg/raster/R/expand.R	2009-05-03 02:37:41 UTC (rev 440)
+++ pkg/raster/R/expand.R	2009-05-03 02:53:35 UTC (rev 441)
@@ -49,7 +49,7 @@
 		if (!canProcessInMemory(outraster, 4) && filename == '') {
 			filename <- rasterTmpFile()
 			filename(outraster) <- filename
-			if (options('verbose')[[1]]) { cat('writing raster to:', filename(raster))	}						
+			if (getOption('verbose')) { cat('writing raster to:', filename(raster))	}						
 		}
 		starttime <- proc.time()
 

Modified: pkg/raster/R/project.R
===================================================================
--- pkg/raster/R/project.R	2009-05-03 02:37:41 UTC (rev 440)
+++ pkg/raster/R/project.R	2009-05-03 02:53:35 UTC (rev 441)
@@ -56,7 +56,7 @@
 	if (!canProcessInMemory(to, 1) && filename(to) == '') {
 		filename <- rasterTmpFile()
 		filename(to) <- filename
-		if (options('verbose')[[1]]) { cat('writing raster to:', filename(to))	}
+		if (getOption('verbose')) { cat('writing raster to:', filename(to))	}
 	}
 	starttime <- proc.time()
 

Modified: pkg/raster/R/rasterTmpFile.R
===================================================================
--- pkg/raster/R/rasterTmpFile.R	2009-05-03 02:37:41 UTC (rev 440)
+++ pkg/raster/R/rasterTmpFile.R	2009-05-03 02:53:35 UTC (rev 441)
@@ -17,7 +17,7 @@
 
 
 rasterTmpDir <- function() {
-	d <- options('rasterTmpDir')[[1]]
+	d <- getOption('rasterTmpDir')
 	if (is.null(d)) {
 		d <- paste(dirname(tempdir()), '/R_raster_tmp/', sep="")
 	}

Modified: pkg/raster/R/readBlock.R
===================================================================
--- pkg/raster/R/readBlock.R	2009-05-03 02:37:41 UTC (rev 440)
+++ pkg/raster/R/readBlock.R	2009-05-03 02:53:35 UTC (rev 441)
@@ -11,7 +11,7 @@
 	
 	endrow <- startrow+nrows-1
 	if (endrow > nrow(raster)) {
-		if (options('verbose')[[1]]) { 
+		if (getOption('verbose')) { 
 			warning("Rows beyond end of raster not read") 
 		}
 		endrow <- nrow(raster)

Modified: pkg/raster/R/readRows.R
===================================================================
--- pkg/raster/R/readRows.R	2009-05-03 02:37:41 UTC (rev 440)
+++ pkg/raster/R/readRows.R	2009-05-03 02:53:35 UTC (rev 441)
@@ -12,7 +12,7 @@
 	
 	endrow <- startrow+nrows-1
 	if (endrow > nrow(raster)) {
-		if (options('verbose')[[1]]) { 
+		if (getOption('verbose')) { 
 			warning("Rows beyond end of raster not read") 
 		}
 		endrow <- nrow(raster)

Modified: pkg/raster/R/reclass.R
===================================================================
--- pkg/raster/R/reclass.R	2009-05-03 02:37:41 UTC (rev 440)
+++ pkg/raster/R/reclass.R	2009-05-03 02:53:35 UTC (rev 441)
@@ -18,14 +18,14 @@
 	if ( dim(rclmat)[2] != 3 ) { stop('rclmat must have 3 columns') }
 	colnames(rclmat) <- c("From", "To", "Becomes")	
 	
-	if (options('verbose')[[1]]) {
+	if (getOption('verbose')) {
 		print(rclmat)
 	}
 	
 	if (dataContent(raster) == 'all') { nr <- 1 } else { nr <- 2 }
 	if (!canProcessInMemory(raster, nr) && filename == '') {
 		filename <- rasterTmpFile()
-		if (options('verbose')[[1]]) { cat('writing raster to:', filename(outRaster))	}						
+		if (getOption('verbose')) { cat('writing raster to:', filename(outRaster))	}						
 	}
 	
 	outRaster <- raster(raster)

Modified: pkg/raster/R/resample.R
===================================================================
--- pkg/raster/R/resample.R	2009-05-03 02:37:41 UTC (rev 440)
+++ pkg/raster/R/resample.R	2009-05-03 02:53:35 UTC (rev 441)
@@ -18,7 +18,7 @@
 	if (!canProcessInMemory(to, 1) && filename(to) == '') {
 		filename <- rasterTmpFile()
 		filename(to) <- filename
-		if (options('verbose')[[1]]) { cat('writing raster to:', filename(to))	}
+		if (getOption('verbose')) { cat('writing raster to:', filename(to))	}
 	}
 	inMemory <- filename(to) == ""
 

Modified: pkg/raster/man/tmpDir.Rd
===================================================================
--- pkg/raster/man/tmpDir.Rd	2009-05-03 02:37:41 UTC (rev 440)
+++ pkg/raster/man/tmpDir.Rd	2009-05-03 02:53:35 UTC (rev 441)
@@ -28,9 +28,13 @@
 }
 
 \arguments{
-\item{d}{The new temporary files directory (for this session)}
+\item{d}{The new temporary files directory (for this session); If \code{d} is \code{NULL}, temp dir is set to the default temporary directory}
 }
 
+\details{
+\code{setTmpDir} creates a global option called rasterTmpDir. See ?options.
+}
+
 \value{
 \code{rasterTmpDir} returns the current directory for temporary files (for the Raster package)
 
@@ -43,13 +47,10 @@
 setTmpDir(d=NULL) sets a global option for the current sessions, but returns nothing
 }
 
-\details{
-\code{removeRasterFile} can also take a filename as argument in stead of a RasterLayer. 
-}
 
 \author{Robert J. Hijmans}
 
-\seealso{ \code{\link[base]{tempdir}} }  
+\seealso{ \code{\link[base]{tempfile}} }  
 
 
 \keyword{ spatial }



More information about the Raster-commits mailing list