[rkward-cvs] SF.net SVN: rkward: [1140] trunk/rkward/rkward/plugins/plots/cor_graph.php
tfry at users.sourceforge.net
tfry at users.sourceforge.net
Sun Jan 14 15:25:21 UTC 2007
Revision: 1140
http://svn.sourceforge.net/rkward/?rev=1140&view=rev
Author: tfry
Date: 2007-01-14 07:25:21 -0800 (Sun, 14 Jan 2007)
Log Message:
-----------
Formatting only
Modified Paths:
--------------
trunk/rkward/rkward/plugins/plots/cor_graph.php
Modified: trunk/rkward/rkward/plugins/plots/cor_graph.php
===================================================================
--- trunk/rkward/rkward/plugins/plots/cor_graph.php 2007-01-14 15:23:15 UTC (rev 1139)
+++ trunk/rkward/rkward/plugins/plots/cor_graph.php 2007-01-14 15:25:21 UTC (rev 1140)
@@ -1,25 +1,25 @@
<?
function preprocess () { ?>
- 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=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"); ?>) 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)
+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=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"); ?>) 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 () {
@@ -28,29 +28,23 @@
function printout () {
$vars = str_replace ("\n", ",", trim (getRK_val ("x"))) ;
?>
+rk.temp.x<- data.frame (<? echo ($vars); ?>)
+rk.header ("Correlation Matrix Plot", parameters=list ("Method", "<? getRK ("method"); ?>", "Exclusion", "<? getRK ("use"); ?>", "Precision", "<? getRK ("digits"); ?> digits", "Scale text", "<? getRK ("scale"); ?>"))
+rk.graph.on ()
+try ({
+ rk.temp.cor.graph (rk.temp.x)
+})
+rk.graph.off ()
- rk.temp.x<- data.frame (<? echo ($vars); ?>)
-
- rk.header ("Correlation Matrix Plot", parameters=list ("Method", "<? getRK ("method"); ?>", "Exclusion", "<? getRK ("use"); ?>", "Precision", "<? getRK ("digits"); ?> digits", "Scale text", "<? getRK ("scale"); ?>"))
-
- rk.graph.on ()
-
- try ({
- rk.temp.cor.graph (rk.temp.x)
- })
-
- rk.graph.off ()
-
- print("Signif. codes: 0 '***', 0.001 '**', 0.01 '*', 0.05 '.'', 0.1 ' ', 1")
-
+print("Signif. codes: 0 '***', 0.001 '**', 0.01 '*', 0.05 '.'', 0.1 ' ', 1")
<?
}
function cleanup () {
?>
- rm(rk.temp.cor.graph,rk.temp.x)
+rm(rk.temp.cor.graph, rk.temp.x)
<?
}
?>
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