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

nono_231 at users.sourceforge.net nono_231 at users.sourceforge.net
Thu Jan 25 17:52:16 UTC 2007


Revision: 1222
          http://svn.sourceforge.net/rkward/?rev=1222&view=rev
Author:   nono_231
Date:     2007-01-25 09:52:16 -0800 (Thu, 25 Jan 2007)

Log Message:
-----------
PHP wraping of function at .php. Added the vector option at .xml and .rkh.

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

Modified: trunk/rkward/rkward/plugins/plots/barplot.php
===================================================================
--- trunk/rkward/rkward/plugins/plots/barplot.php	2007-01-25 12:04:17 UTC (rev 1221)
+++ trunk/rkward/rkward/plugins/plots/barplot.php	2007-01-25 17:52:16 UTC (rev 1222)
@@ -1,23 +1,6 @@
 <?
 	function preprocess () {
-	?>
-rk.temp.barplot2<-function(x, beside=<? getRK ("beside"); ?>, legend.text=<? getRK ("legend"); ?>, rainbow=<? getRK ("rainbow"); ?>, labels=<? getRK ("labels"); ?>, place=<? getRK ("place"); ?>){
-if(beside){
-		if(rainbow) {		
-		rk.temp.barplot <- barplot((x), col=rainbow(x), beside=beside, legend.text=legend.text,  ylim = range(x) * c(0, 1.2))
-		}
-		else {
-		rk.temp.barplot <- barplot((x), beside=beside, legend.text=legend.text,  ylim = range(x) * c(0, 1.2))
-		}
-		if(labels) text(rk.temp.barplot,x, labels=x, pos=place, offset=.5)
-	}
-	else {
-		if(rainbow) barplot((x), col=rainbow(x), legend.text=legend.text)
-		else barplot((x), legend.text=legend.text)
 }
-}
-<?
-}
 	
 	function calculate () {
 }
@@ -26,19 +9,31 @@
 	$vars = str_replace ("\n", ",", trim (getRK_val ("x"))) ; 
 	?>
 
-rk.temp.x2 <- (<? echo ($vars); ?>)
-if(is.matrix(rk.temp.x2)) rk.temp.x=rk.temp.x2
-if(is.factor(rk.temp.x2)) rk.temp.x=summary(rk.temp.x2)
+rk.temp.x <- (<? echo ($vars); ?>)
+if(is.factor(rk.temp.x)) rk.temp.x=summary(rk.temp.x)
 
 rk.header ("Barplot", parameters=list ("Rainbow colors", "<? getRK ("rainbow"); ?>", "Beside", "<? getRK ("beside"); ?>", "Legend", "<? getRK ("legend"); ?>"))
 
 rk.graph.on ()
 try ({
-rk.temp.barplot2(rk.temp.x)	
+	<?
+	if (getRK_val ("beside") == "TRUE") {
+	?>rk.temp.barplot <-barplot((rk.temp.x)<? if (getRK_val ("rainbow")=="TRUE") { ?>,
+col=rainbow(rk.temp.x) <? } ?>, beside=<? getRK ("beside"); ?>, legend.text=<?
+getRK ("legend"); ?>,  ylim = range(rk.temp.x) * c(0, 1.2))
+	 <?
+	}
+	if ((getRK_val ("beside") == "TRUE") && getRK_val ("labels")=="TRUE") { ?>
+text(rk.temp.barplot, rk.temp.x, labels=rk.temp.x, pos=<? getRK ("place"); ?>,
+offset=.5)
+	<? } 
+	if (getRK_val ("beside") == "FALSE") {
+?> barplot((rk.temp.x)<? if (getRK_val ("rainbow")=="TRUE") { ?>,
+col=rainbow(rk.temp.x) <? } ?>, legend.text=<? getRK ("legend"); ?>)
+	<? } ?>
 })
 rk.graph.off ()
 
-
 <?
 	}
 	

Modified: trunk/rkward/rkward/plugins/plots/barplot.rkh
===================================================================
--- trunk/rkward/rkward/plugins/plots/barplot.rkh	2007-01-25 12:04:17 UTC (rev 1221)
+++ trunk/rkward/rkward/plugins/plots/barplot.rkh	2007-01-25 17:52:16 UTC (rev 1222)
@@ -5,12 +5,12 @@
 	</summary>
 
 	<usage>
-Choose a matrix or a factor to be plotted. Choose if you want stacked bars, legend, and rainbow colors. Also you can choose if you want to display or not bar values (labels) and in what place.
+Choose a matrix, vector or a factor to be plotted. Choose if you want stacked bars, legend, and rainbow colors. Also you can choose if you want to display or not bar values (labels) and in what place.
 	</usage>
 
 	<settings>
 		<caption id="tab_variables"/>
-		<setting id="x">Select a data matrix or a factor to be plotted.</setting>
+		<setting id="x">Select a data matrix, a vector or a factor to be plotted.</setting>
 		<caption id="tab_options"/>
 		<setting id="legend">Select if you want to add a legend to the barplot. The row names of height will be used as labels if they are non-null.</setting>
 		<setting id="rainbow">Select between grey and rainbow collors.</setting>

Modified: trunk/rkward/rkward/plugins/plots/barplot.xml
===================================================================
--- trunk/rkward/rkward/plugins/plots/barplot.xml	2007-01-25 12:04:17 UTC (rev 1221)
+++ trunk/rkward/rkward/plugins/plots/barplot.xml	2007-01-25 17:52:16 UTC (rev 1222)
@@ -15,7 +15,7 @@
 				<row>
 					<varselector id="vars"/>
 					<column>
-					<varslot min_vars="1" id="x" source="vars" required="true" label="Matrix or Factor"/>
+					<varslot min_vars="1" id="x" source="vars" required="true" label="Matrix, Vector or Factor"/>
 					</column>
 				</row>
 			</tab>


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