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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Apr 15 13:46:38 CEST 2009


Author: romain
Date: 2009-04-15 13:46:38 +0200 (Wed, 15 Apr 2009)
New Revision: 71

Modified:
   pkg/zooimage/R/ZIClass.r
Log:
using pmin instead of for loop

Modified: pkg/zooimage/R/ZIClass.r
===================================================================
--- pkg/zooimage/R/ZIClass.r	2009-04-15 11:44:56 UTC (rev 70)
+++ pkg/zooimage/R/ZIClass.r	2009-04-15 11:46:38 UTC (rev 71)
@@ -224,11 +224,9 @@
 	nX <- nrow(confmat)
 	nY <- ncol(confmat)
 	nZ <- nX*nY
-	for (i in 1:nZ) {
-		if (confmat[i]>= maxval) {  # max = max number of items by cell
-			confmat[i]= maxval
-		}
-	}
+	
+	confmat <- pmin( confmat, maxval )
+	
 	library(RColorBrewer)
 	mypalette <- brewer.pal(maxval-1, "Spectral")
 	#hc <- c("#FFFFFF", rev(heat.colors(maxval)))



More information about the Zooimage-commits mailing list