[rkward-cvs] SF.net SVN: rkward: [1478] trunk/rkward/rkward/plugins/plots
nono_231 at users.sourceforge.net
nono_231 at users.sourceforge.net
Mon Feb 26 17:14:38 UTC 2007
Revision: 1478
http://svn.sourceforge.net/rkward/?rev=1478&view=rev
Author: nono_231
Date: 2007-02-26 09:14:37 -0800 (Mon, 26 Feb 2007)
Log Message:
-----------
Added tabulate option for vars in barplot plugin
Modified Paths:
--------------
trunk/rkward/rkward/plugins/plots/barplot.php
trunk/rkward/rkward/plugins/plots/barplot.xml
Modified: trunk/rkward/rkward/plugins/plots/barplot.php
===================================================================
--- trunk/rkward/rkward/plugins/plots/barplot.php 2007-02-26 16:19:22 UTC (rev 1477)
+++ trunk/rkward/rkward/plugins/plots/barplot.php 2007-02-26 17:14:37 UTC (rev 1478)
@@ -24,16 +24,18 @@
function doPrintout ($final) {
$vars = getRK_val ("x") ;
$labels = getRK_val ("labels")=="TRUE";
+ $tabulate= getRK_val ("tabulate")=="TRUE";
+
?>
rk.temp.x <- (<? echo ($vars); ?>)
-if(is.factor(rk.temp.x)) {
- rk.temp.x <- summary(rk.temp.x)
-} else {
+<?
+if($tabulate) {?>
+ rk.temp.x <- table(rk.temp.x, exclude=NULL)
+<? } else { ?>
# barplot is a bit picky about attributes, so we need to convert to vector explicitely
if(!is.matrix(rk.temp.x)) rk.temp.x <- as.vector(rk.temp.x)
-}
+<? }
-<?
if ($final) { ?>
rk.header ("Barplot", parameters=list ("Rainbow colors", "<? getRK ("rainbow"); ?>", "Beside", "<? getRK ("beside"); ?>", "Legend", "<? getRK ("legend"); ?>"))
Modified: trunk/rkward/rkward/plugins/plots/barplot.xml
===================================================================
--- trunk/rkward/rkward/plugins/plots/barplot.xml 2007-02-26 16:19:22 UTC (rev 1477)
+++ trunk/rkward/rkward/plugins/plots/barplot.xml 2007-02-26 17:14:37 UTC (rev 1478)
@@ -15,6 +15,7 @@
<row>
<varselector id="vars"/>
<column>
+ <checkbox id="tabulate" label="Tabulate for factor variables" value="TRUE" value_unchecked="FALSE" checked="false" />
<varslot min_vars="1" id="x" source="vars" required="true" label="Matrix, Vector or Factor"/>
<preview id="preview"/>
</column>
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