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

kapatp at users.sourceforge.net kapatp at users.sourceforge.net
Wed Feb 28 05:57:49 UTC 2007


Revision: 1502
          http://svn.sourceforge.net/rkward/?rev=1502&view=rev
Author:   kapatp
Date:     2007-02-27 21:57:49 -0800 (Tue, 27 Feb 2007)

Log Message:
-----------

* Rename histbreaksoptions to histcalcoptions
* Rename histoptions to histplotoptions
* Assign right=FLASE and include.lower=FALSE to histcalcoptions (instead of histplotoptions)
* Assign freq=FLASE to histplotoptions (instead of histcalcoptions)
* Rectify some errors (of using the double quotes) in headeroptions (histogram_options.php)
* Initiate other functions in binomial_clt

Modified Paths:
--------------
    trunk/rkward/rkward/plugins/distributions/plot_binomial_clt.php
    trunk/rkward/rkward/plugins/distributions/plot_binomial_clt.xml
    trunk/rkward/rkward/plugins/plots/histogram_options.php
    trunk/rkward/rkward/plugins/plots/histogram_options.xml

Modified: trunk/rkward/rkward/plugins/distributions/plot_binomial_clt.php
===================================================================
--- trunk/rkward/rkward/plugins/distributions/plot_binomial_clt.php	2007-02-27 22:00:18 UTC (rev 1501)
+++ trunk/rkward/rkward/plugins/distributions/plot_binomial_clt.php	2007-02-28 05:57:49 UTC (rev 1502)
@@ -44,9 +44,9 @@
 	}
 
 	if ($fun == "hist") {
-		$histbreaksoptions = getRK_val ("histogram_opt.code.calculate");
-		$histoptions = getRK_val ("histogram_opt.code.printout");
-		$histoptions .= getRK_val("plotoptions.code.printout");
+		$histcalcoptions = getRK_val ("histogram_opt.code.calculate");
+		$histplotoptions = getRK_val ("histogram_opt.code.printout");
+		$histplotoptions .= getRK_val("plotoptions.code.printout");
 	}
 ?>
 rk.temp.cltdistrib <- list()
@@ -65,9 +65,9 @@
 <? }
   if ($fun == "hist") {
 ?>
-rk.temp.cltdistrib$hist <- hist(rk.temp.cltdistrib$avg, plot=FALSE<? echo ($histbreaksoptions); ?>);
+rk.temp.cltdistrib$hist <- hist(rk.temp.cltdistrib$avg, plot=FALSE<? echo ($histcalcoptions); ?>);
 rk.temp.cltdistrib$ylim <- c(0,max(c(rk.temp.cltdistrib$hist$density, rk.temp.cltdistrib$normY)));
-try( plot(rk.temp.cltdistrib$hist, ylim=rk.temp.cltdistrib$ylim<? echo ($histoptions); ?>) );
+try( plot(rk.temp.cltdistrib$hist, ylim=rk.temp.cltdistrib$ylim<? echo ($histplotoptions); ?>) );
 <?
   }
 ?>

Modified: trunk/rkward/rkward/plugins/distributions/plot_binomial_clt.xml
===================================================================
--- trunk/rkward/rkward/plugins/distributions/plot_binomial_clt.xml	2007-02-27 22:00:18 UTC (rev 1501)
+++ trunk/rkward/rkward/plugins/distributions/plot_binomial_clt.xml	2007-02-28 05:57:49 UTC (rev 1502)
@@ -18,6 +18,9 @@
 		<convert id="isHistogram" sources="function.string" mode="equals" standard="hist"/>
 		<connect client="tab_histoptions.enabled" governor="isHistogram"/>
 
+		<convert id="isDist" sources="function.string" mode="equals" standard="dist"/>
+		<connect client="tab_distfunction.enabled" governor="isDist"/>
+
 		<connect client="normpointtype.enabled" governor="drawnorm.state"/>
 		<connect client="normlinecol.color.enabled" governor="drawnorm.state"/>
 	</logic>
@@ -66,6 +69,9 @@
 			<tab id="tab_histoptions" label="Histogram">
 				<embed id="histogram_opt" component="rkward::histogram_options" label="Histogram Options"/>
 			</tab>
+			<tab id="tab_distfunction" label="Distribution function">
+				<checkbox id="dist_lowertail" label="Lower tail" checked="true"/>
+			</tab>
 		</tabbook>
 	</dialog>
 </document>

Modified: trunk/rkward/rkward/plugins/plots/histogram_options.php
===================================================================
--- trunk/rkward/rkward/plugins/plots/histogram_options.php	2007-02-27 22:00:18 UTC (rev 1501)
+++ trunk/rkward/rkward/plugins/plots/histogram_options.php	2007-02-28 05:57:49 UTC (rev 1502)
@@ -1,49 +1,35 @@
 <?
 function makeCodes () {
-	global $histbreaksoptions;
-	global $histoptions;
+	global $histcalcoptions;
+	global $histplotoptions;
 	global $headeroptions;
 
-	$histbreaksoptions = ", breaks=";
-	$histoptions = "";
+	$histcalcoptions = ", breaks=";
+	$histplotoptions = "";
 	$headeroptions = "";
 	$varname = getRK_val ("varname");
 
 	$histbreaks = getRK_val ("histbreaksFunction");
-	$headeroptions .= ', Breaks, "';
+	$headeroptions .= ', "Break points", "';
 	if ($histbreaks == "cells") {
-		$histbreaksoptions .= getRK_val ("histbreaks_ncells");
-		$headeroptions .= getRK_val ("histbreaks_ncells") . 'cells"';
+		$histcalcoptions .= getRK_val ("histbreaks_ncells");
+		$headeroptions .= 'Approximately ' . getRK_val ("histbreaks_ncells") . ' cells"';
 	} else if ($histbreaks == "int") {
-		$histbreaksoptions .= "seq (floor (min (" . $varname . ", na.rm=TRUE))-0.5, ceiling (max (" . $varname . ", na.rm=TRUE))+0.5)";
-		$headeroptions .= 'integers"';
+		$histcalcoptions .= "seq (floor (min (" . $varname . ", na.rm=TRUE))-0.5, ceiling (max (" . $varname . ", na.rm=TRUE))+0.5)";
+		$headeroptions .= 'Integers"';
 	}
 	else if ($histbreaks == "vec") {
-		$histbreaksoptions .= "(function(x) {y = extendrange(x,f=0.1); seq(from=y[1], to=y[2], length=" . getRK_val ("histbreaks_veclength") . ")})(" . $varname . ")";
-		$headeroptions .= 'vector length ' . getRK_val ("histbreaks_veclength") . '"';
+		$histcalcoptions .= "(function(x) {y = extendrange(x,f=0.1); seq(from=y[1], to=y[2], length=" . getRK_val ("histbreaks_veclength") . ")})(" . $varname . ")";
+		$headeroptions .= 'Equally spaced vector of length ' . getRK_val ("histbreaks_veclength") . '"';
 	} else {
-		$histbreaksoptions .= "\"" . $histbreaks . "\"";
+		$histcalcoptions .= "\"" . $histbreaks . "\"";
 		$headeroptions .= $histbreaks . '"';
 	}
 
-	$addbars = getRK_val ("addtoplot");
-	if ($addbars) $histoptions .= ", add=TRUE";
-
-	$freq = getRK_val ("freq");
-	if (!$freq) {
-		$histoptions .= ", freq=FALSE";
-		$headeroptions .= ', Scale, "Density"';
-	} else {
-		$headeroptions .= ', Scale, "Frequency"';
-	}
-
-	$labels = getRK_val ("barlabels");
-	if ($labels) $histoptions .= ", labels=TRUE";
-
 	$right = getRK_val ("rightclosed");
 	if (!$right) {
 		$headeroptions .= ', "Right closed", "FALSE"';
-		$histoptions .= ", right=FALSE";
+		$histcalcoptions .= ", right=FALSE";
 	} else {
 		$headeroptions .= ', "Right closed", "TRUE"';
 	}
@@ -51,18 +37,32 @@
 	$inclowest = getRK_val ("include_lowest");
 	if (!$inclowest) {
 		$headeroptions .= ', "Include in lowest cell", "FALSE"';
-		$histoptions .= ", include.lowest=FALSE";
+		$histcalcoptions .= ", include.lowest=FALSE";
 	} else {
 		$headeroptions .= ', "Include in lowest cell", "TRUE"';
 	}
 
+	$freq = getRK_val ("freq");
+	if (!$freq) {
+		$histplotoptions .= ", freq=FALSE";
+		$headeroptions .= ', "Scale", "Density"';
+	} else {
+		$headeroptions .= ', "Scale", "Frequency"';
+	}
+
+	$addbars = getRK_val ("addtoplot");
+	if ($addbars) $histplotoptions .= ", add=TRUE";
+
+	$labels = getRK_val ("barlabels");
+	if ($labels) $histplotoptions .= ", labels=TRUE";
+
 	$histlty = getRK_val ("histlinetype");
-	$histoptions .= ", lty=" . "\"" . $histlty . "\"";
+	$histplotoptions .= ", lty=" . "\"" . $histlty . "\"";
 
 	if ($histlty != "blank") {
 		$density = getRK_val ("density");
-		$histoptions .= ", density=" . $density;
-		if ($density > 0) $histoptions .= ", angle=" . getRK_val ("angle");
+		$histplotoptions .= ", density=" . $density;
+		if ($density > 0) $histplotoptions .= ", angle=" . getRK_val ("angle");
 		if (getRK_val ("doborder")) $histbordercol = getRK_val ("histbordercol.code.printout");
 		else $histbordercol = ", border=FALSE";
 	}
@@ -70,7 +70,7 @@
 	$histfillcol = "";
 	if (getRK_val ("usefillcol")) $histfillcol = getRK_val ("histfillcol.code.printout");
 
-	$histoptions .= $histbordercol . $histfillcol;
+	$histplotoptions .= $histbordercol . $histfillcol;
 }
 
 function preprocess () {
@@ -82,19 +82,19 @@
 }
 
 function calculate () {
-	global $histbreaksoptions;
+	global $histcalcoptions;
 
 	// makeCodes() has already run
 
-	echo ($histbreaksoptions);
+	echo ($histcalcoptions);
 }
 
 function printout () {
-	global $histoptions;
+	global $histplotoptions;
 
 	// makeCodes() has already run
 
-	echo ($histoptions);
+	echo ($histplotoptions);
 }
 
 function cleanup () {

Modified: trunk/rkward/rkward/plugins/plots/histogram_options.xml
===================================================================
--- trunk/rkward/rkward/plugins/plots/histogram_options.xml	2007-02-27 22:00:18 UTC (rev 1501)
+++ trunk/rkward/rkward/plugins/plots/histogram_options.xml	2007-02-28 05:57:49 UTC (rev 1502)
@@ -20,6 +20,10 @@
 		<convert id="isbreaks_vec" sources="histbreaksFunction.string" mode="equals" standard="vec"/>
 		<connect client="histbreaks_veclength.enabled" governor="isbreaks_vec"/>
 
+		<convert id="isbreaks_int" sources="histbreaksFunction.string" mode="equals" standard="int"/>
+		<convert id="isbreaks_intORvec" mode="or" sources="isbreaks_int;isbreaks_vec"/>
+		<connect client="include_lowest.enabled" governor="isbreaks_intORvec"/>
+
 		<convert id="isdensityGT0" mode="range" sources="density.int" min="1" />
 		<convert id="ishistlty_notblank" sources="histlinetype.string" mode="notequals" standard="blank" />
 		<convert id="ishistlty_blank" sources="histlinetype.string" mode="equals" standard="blank" />
@@ -62,7 +66,10 @@
 						<spinbox id="histbreaks_veclength" label="Vector length" type="integer" min="1" initial="10"/>
 					</row>
 					<checkbox id="rightclosed" label="Right closed" checked="true"/>
+					<row>
 					<checkbox id="include_lowest" label="Include in lowest cell" checked="true"/>
+					<text id="inclow_text">(For vector valued breaks)</text>
+				</row>
 				</frame>
 			</column>
 			<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