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

nono_231 at users.sourceforge.net nono_231 at users.sourceforge.net
Thu Feb 22 16:48:45 UTC 2007


Revision: 1425
          http://svn.sourceforge.net/rkward/?rev=1425&view=rev
Author:   nono_231
Date:     2007-02-22 08:48:44 -0800 (Thu, 22 Feb 2007)

Log Message:
-----------
Pareto chart plugin added under the plots menu.

Added Paths:
-----------
    trunk/rkward/rkward/plugins/plots/pareto.php
    trunk/rkward/rkward/plugins/plots/pareto.rkh
    trunk/rkward/rkward/plugins/plots/pareto.xml

Added: trunk/rkward/rkward/plugins/plots/pareto.php
===================================================================
--- trunk/rkward/rkward/plugins/plots/pareto.php	                        (rev 0)
+++ trunk/rkward/rkward/plugins/plots/pareto.php	2007-02-22 16:48:44 UTC (rev 1425)
@@ -0,0 +1,52 @@
+<?
+function preprocess () {
+?> require(qcc) 
+require(xtable)
+<?
+}
+	
+function calculate () {
+}
+
+function printout () {
+	doPrintout (true);
+}
+	
+function cleanup () { ?>
+rm (list=grep ("^rk.temp", ls (), value=TRUE))
+<?
+}
+	
+function preview () {
+	preprocess ();
+	calculate ();
+	doPrintout (false);
+	cleanup ();
+}
+	
+function doPrintout ($final) {
+	$vars = str_replace ("\n", ",", trim (getRK_val ("x"))) ;
+?>
+rk.temp.x <- (<? echo ($vars); ?>)
+if(is.factor(rk.temp.x)) {
+	rk.temp.x <- summary(rk.temp.x)
+} else rk.temp.x
+
+<? 
+	if ($final) { ?>
+rk.header ("Pareto chart")
+
+rk.graph.on ()
+<?	}
+?>
+try ({ 
+<?
+if ($final) { ?>
+rk.print(<?}?>pareto.chart(rk.temp.x, main="") <? if ($final) { ?>)<?}
+?>
+})
+<?	if ($final) { ?>
+rk.graph.off ()
+<? }
+}
+?>

Added: trunk/rkward/rkward/plugins/plots/pareto.rkh
===================================================================
--- trunk/rkward/rkward/plugins/plots/pareto.rkh	                        (rev 0)
+++ trunk/rkward/rkward/plugins/plots/pareto.rkh	2007-02-22 16:48:44 UTC (rev 1425)
@@ -0,0 +1,20 @@
+<!DOCTYPE rkhelp>
+<document>
+	<summary>
+Creates a pareto chart and prints the values.
+	</summary>
+
+	<usage>
+Choose a vector or a factor to be plotted. The Frequency, Cum.Frequency, Percentage and Cum.Percentage will be printed under the plot.
+	</usage>
+
+	<settings>
+		<caption id="tab_variables"/>
+		<setting id="x">Select a data vector or a factor to be plotted.</setting>
+	</settings>
+	<related>
+		<ul>
+			<li><link href="rkward://rhelp/pareto.chart"/></li>
+		</ul>
+	</related>
+</document>

Added: trunk/rkward/rkward/plugins/plots/pareto.xml
===================================================================
--- trunk/rkward/rkward/plugins/plots/pareto.xml	                        (rev 0)
+++ trunk/rkward/rkward/plugins/plots/pareto.xml	2007-02-22 16:48:44 UTC (rev 1425)
@@ -0,0 +1,19 @@
+<!DOCTYPE rkplugin>
+<document>
+	<code file="pareto.php" />
+	<help file="pareto.rkh" />
+	<dialog label="Pareto chart" >		
+		<tabbook>
+			<tab label="Variables" id="tab_variables">
+				<row>
+					<varselector id="vars"/>
+					<column>
+					<varslot min_vars="1" id="x" source="vars" required="true" label="Vector or Factor"/>
+					<preview id="preview"/>
+					</column>
+				</row>
+			</tab>	
+		</tabbook>			
+	</dialog>
+
+</document>


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