[Raster-commits] r467 - pkg/raster/man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Aug 7 02:50:42 CEST 2009


Author: rhijmans
Date: 2009-08-07 02:50:40 +0200 (Fri, 07 Aug 2009)
New Revision: 467

Modified:
   pkg/raster/man/predict.Rd
Log:


Modified: pkg/raster/man/predict.Rd
===================================================================
--- pkg/raster/man/predict.Rd	2009-08-05 01:09:06 UTC (rev 466)
+++ pkg/raster/man/predict.Rd	2009-08-07 00:50:40 UTC (rev 467)
@@ -72,9 +72,11 @@
 v <- cbind(xy[,1], xyValues(logo, xy[,2:3]))
 colnames(v)[1] <- 'presabs'
 
-#build model
-formula <- paste(colnames(v)[1], '~', paste(colnames(v)[2:ncol(v)], collapse=" + "))
+#build model, e.g. with glm or randomforest
+formula <- as.formula(paste(colnames(v)[1], '~', paste(colnames(v)[2:ncol(v)], collapse=" + ")))
 model <- glm(formula, data=data.frame(v))
+# require(randomForest)
+# model <- randomForest(formula, data=data.frame(v))
 
 #predict to a raster
 r <- predict(logo, model)



More information about the Raster-commits mailing list