[rkward-cvs] SF.net SVN: rkward: [1139] trunk/rkward/rkward/plugins/plots

tfry at users.sourceforge.net tfry at users.sourceforge.net
Sun Jan 14 15:23:15 UTC 2007


Revision: 1139
          http://svn.sourceforge.net/rkward/?rev=1139&view=rev
Author:   tfry
Date:     2007-01-14 07:23:15 -0800 (Sun, 14 Jan 2007)

Log Message:
-----------
Update of correlation matrix plot plugin (I. Soumpasis) (NOT for 0.4.5)

Modified Paths:
--------------
    trunk/rkward/rkward/plugins/plots/cor_graph.php
    trunk/rkward/rkward/plugins/plots/cor_graph.xml

Modified: trunk/rkward/rkward/plugins/plots/cor_graph.php
===================================================================
--- trunk/rkward/rkward/plugins/plots/cor_graph.php	2007-01-12 15:51:06 UTC (rev 1138)
+++ trunk/rkward/rkward/plugins/plots/cor_graph.php	2007-01-14 15:23:15 UTC (rev 1139)
@@ -1,26 +1,25 @@
 <?
 	function preprocess () { ?>
-		rk.temp.cor.graph <- function(x) {
-			panel.cor <- function(x, y, digits=<? getRK ("digits"); ?>, cex.cor) {
-    				usr <- par("usr"); on.exit(par(usr))
-    				par(usr = c(0, 1, 0, 1))
-    				r <- abs(cor(x, y, use="<? getRK ("use"); ?>", method="<? getRK ("method"); ?>"))
-    				txt <- format(c(r, 0.123456789), digits=digits)[1]
-    				txt <- paste(txt, sep="")
-    				if(missing(cex.cor)) cex <- 0.8/strwidth(txt)
+	rk.temp.cor.graph <- function(x) {
+		panel.cor <- function(x, y, digits=<? getRK ("digits"); ?>, cex.cor, use="<? getRK ("use"); ?>", method="<? getRK ("method"); ?>") {
+			usr <- par("usr"); on.exit(par(usr))
+			par(usr = c(0, 1, 0, 1))
+    			r <- abs(cor(x, y, use=use, method=method))
+    			txt <- format(c(r, 0.123456789), digits=digits)[1]
+    			txt <- paste(txt, sep="")
+    			if(missing(cex.cor)) cex <- 0.8/strwidth(txt)
      		
-     				test <- cor.test(x,y, use="<? getRK ("use"); ?>", method="<? getRK ("method"); ?>")
-				Signif <- symnum(test$p.value, corr = FALSE, na = FALSE,
-                  				cutpoints = c(0, 0.001, 0.01, 0.05, 0.1, 1),
-                  				symbols = c("***", "**", "*", ".", " "))
+     			test <- cor.test(x,y, use=use, method=method)
+			Signif <- symnum(test$p.value, corr = FALSE, na = FALSE,
+           				cutpoints = c(0, 0.001, 0.01, 0.05, 0.1, 1),
+                  			symbols = c("***", "**", "*", ".", " "))
     
-    				if("<? getRK ("scale"); ?>"=="yes") text(0.5, 0.5, txt, cex = cex * r)
-    				if("<? getRK ("scale"); ?>"=="no") text(0.5, 0.5, txt, cex = cex)
-    				text(.8, .8, Signif, cex=cex, col=2)
-			}
-			pairs(x, 
-  			lower.panel=panel.smooth, upper.panel=panel.cor)
+    			if(<? getRK ("scale"); ?>)  text(0.5, 0.5, txt, cex = cex * r)
+    			else text(0.5, 0.5, txt, cex = cex)
+    			text(.8, .8, Signif, cex=cex, col=2)
 		}
+		pairs(x, lower.panel=panel.smooth, upper.panel=panel.cor)
+	}
 	<?		}
 	
 	function calculate () {
@@ -34,7 +33,7 @@
 
 	rk.temp.x<- data.frame (<? echo ($vars); ?>)
 
-	rk.header ("Correlation Matrix Plot")
+	rk.header ("Correlation Matrix Plot", parameters=list ("Method", "<? getRK ("method"); ?>", "Exclusion", "<? getRK ("use"); ?>", "Precision", "<? getRK ("digits"); ?> digits", "Scale text", "<? getRK ("scale"); ?>"))
 
 	rk.graph.on ()
 

Modified: trunk/rkward/rkward/plugins/plots/cor_graph.xml
===================================================================
--- trunk/rkward/rkward/plugins/plots/cor_graph.xml	2007-01-12 15:51:06 UTC (rev 1138)
+++ trunk/rkward/rkward/plugins/plots/cor_graph.xml	2007-01-14 15:23:15 UTC (rev 1139)
@@ -20,15 +20,8 @@
 					<option value="complete.obs" label="whole cases"/>
 					<option value="pairwise.complete.obs" label="pairwise" checked="true"/>
 				</radio>
-				<radio id="digits" label="Precision">
-					<option value="1" label="1"/>
-					<option value="2" label="2"/>
-					<option value="3" label="3" checked="true"/>
-				</radio>
-				<radio id="scale" label="Scale text">
-					<option value="yes" label="Yes" checked="true"/>
-					<option value="no" label="No"/>
-				</radio>
+				<spinbox id="digits" label="Precision" type="integer" min="0" max="5" initial="3"/> 
+				<checkbox id="scale" label="Scale text" value="TRUE" value_unchecked="FALSE" checked="true"/>
 			</tab>
 		</tabbook>			
 	</dialog>


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list