[Raster-commits] r469 - pkg/raster/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Aug 10 20:15:09 CEST 2009


Author: rhijmans
Date: 2009-08-10 20:15:08 +0200 (Mon, 10 Aug 2009)
New Revision: 469

Modified:
   pkg/raster/R/predict.R
Log:


Modified: pkg/raster/R/predict.R
===================================================================
--- pkg/raster/R/predict.R	2009-08-10 17:48:32 UTC (rev 468)
+++ pkg/raster/R/predict.R	2009-08-10 18:15:08 UTC (rev 469)
@@ -16,7 +16,7 @@
 		dataType(predrast) <- datatype
 		
 		dataclasses <- attr(model$terms, "dataClasses")
-		f <- which(dataclasses == 'factor')
+		f <- names( which(dataclasses == 'factor') )
 		if (length(f) > 0) { 
 			haveFactor <- TRUE 
 		} else {
@@ -37,6 +37,7 @@
 				predrast <- writeRaster(predrast)
 			}
 			return(predrast)
+			
 		} else {
 			for (r in 1:nrow(object)) {
 				object <- readRow(object, r)
@@ -55,5 +56,3 @@
 	}
 )
 
-
-	
\ No newline at end of file



More information about the Raster-commits mailing list