[Zooimage-commits] r205 - pkg/zooimage/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jun 19 14:31:17 CEST 2012


Author: kevin
Date: 2012-06-19 14:31:16 +0200 (Tue, 19 Jun 2012)
New Revision: 205

Modified:
   pkg/zooimage/R/ZIRes.R
Log:
debug sampleAbd function

Modified: pkg/zooimage/R/ZIRes.R
===================================================================
--- pkg/zooimage/R/ZIRes.R	2012-06-19 12:17:32 UTC (rev 204)
+++ pkg/zooimage/R/ZIRes.R	2012-06-19 12:31:16 UTC (rev 205)
@@ -579,10 +579,10 @@
 	} else {
 		if (!inherits(groups, "list")) 
 			stop("'groups' must be a 'list' object")
- 		res <- if (length(groups) == 1 && groups == "") {
-			sum(Smp$Coef)
+ 		if (length(groups) == 1 && groups == "") {
+			res <- sum(Smp$Coef)
 		} else {
-			sapply(groups, function (g)
+			res <- sapply(groups, function (g)
 				sum(Smp$Coef[Smp[, Predictions] %in% g]))
         # problem with sapply function: total = 0!!!!!
             if(isTRUE(as.numeric(res["total"]) == 0)) res["total"] <- sum(Smp$Coef)



More information about the Zooimage-commits mailing list