[Esm-commits] r4 - pkg/ESM/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Nov 10 17:37:57 CET 2009


Author: timotheepoisot
Date: 2009-11-10 17:37:56 +0100 (Tue, 10 Nov 2009)
New Revision: 4

Modified:
   pkg/ESM/R/functions.r
Log:
Added the matrix.hr function

Modified: pkg/ESM/R/functions.r
===================================================================
--- pkg/ESM/R/functions.r	2009-11-10 09:53:31 UTC (rev 3)
+++ pkg/ESM/R/functions.r	2009-11-10 16:37:56 UTC (rev 4)
@@ -195,4 +195,16 @@
 		bg=color,
 		fg=border
 		)
+}
+
+matrix.hr <- function(matrix)
+{
+	for(c in 1:ncol(matrix))
+	{
+		for(r in 1:nrow(matrix))
+		{
+			if(matrix[r,c]>0){matrix[r,c]<-1}
+		}
+	}
+	return(matrix)
 }
\ No newline at end of file



More information about the Esm-commits mailing list