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

tfry at users.sourceforge.net tfry at users.sourceforge.net
Fri Jan 5 12:03:22 UTC 2007


Revision: 1065
          http://svn.sourceforge.net/rkward/?rev=1065&view=rev
Author:   tfry
Date:     2007-01-05 04:03:22 -0800 (Fri, 05 Jan 2007)

Log Message:
-----------
Rename descriptive statistics plugin files

Modified Paths:
--------------
    trunk/rkward/rkward/plugins/Makefile.am
    trunk/rkward/rkward/plugins/all.pluginmap
    trunk/rkward/rkward/plugins/uni1.2/description.xml

Added Paths:
-----------
    trunk/rkward/rkward/plugins/20descriptive/descriptive_statistics.php
    trunk/rkward/rkward/plugins/20descriptive/descriptive_statistics.xml

Removed Paths:
-------------
    trunk/rkward/rkward/plugins/20descriptive/code.php
    trunk/rkward/rkward/plugins/20descriptive/description.xml

Deleted: trunk/rkward/rkward/plugins/20descriptive/code.php
===================================================================
--- trunk/rkward/rkward/plugins/20descriptive/code.php	2007-01-05 11:50:20 UTC (rev 1064)
+++ trunk/rkward/rkward/plugins/20descriptive/code.php	2007-01-05 12:03:22 UTC (rev 1065)
@@ -1,78 +0,0 @@
-<?
-	function preprocess () {
-	}
-	
-	function calculate () {
-		global $mad_type;
-		global $constMad;
-
-		$vars = "substitute (" . str_replace ("\n", "), substitute (", trim (getRK_val ("x"))) . ")";
-		$trim = getRK_val ("trim"); //the fraction (0 to 0.5) of observations to be trimmed from each end of x before the mean is computed
-		$constMad = getRK_val ("constMad");
-		$mad_type = getRK_val ("mad_type");
-
-?>
-rk.temp.vars <- list (<? echo ($vars); ?>)
-rk.temp.results <- data.frame ('Object'=rep (NA, length (rk.temp.vars)))
-i=0;
-for (rk.temp.var in rk.temp.vars) {
-	i = i+1
-	rk.temp.results$'Object'[i] <- rk.get.description (rk.temp.var, is.substitute=TRUE)
-<?
-		if (getRK_val ("mean")) { ?>
-	rk.temp.results$mean[i] <- try (mean (eval (rk.temp.var), trim = <?echo ($trim) ;?>, na.rm=TRUE))
-<?		}
-		if (getRK_val ("median")) { ?>
-	rk.temp.results$median[i] <- try (median (eval (rk.temp.var), na.rm=TRUE))
-<?		}
-		if (getRK_val ("range")) { ?>
-	try ({
-		rk.temp.range <- try (range (eval (rk.temp.var), na.rm=TRUE))
-		rk.temp.results$min[i] <- rk.temp.range[1]
-		rk.temp.results$max[i] <- rk.temp.range[2]
-	})
-<?		}
-		if (getRK_val ("sd")) { ?>
-	rk.temp.results$'standard deviation'[i] <- try (sd (eval (rk.temp.var), na.rm=TRUE))
-<?		}
-		if (getRK_val ("sum")) { ?>
-	rk.temp.results$sum[i] <- try (sum (eval (rk.temp.var), na.rm=TRUE))
-<?		}
-		if (getRK_val ("prod")) { ?>
-	rk.temp.results$prod[i] <- try (prod (eval (rk.temp.var), na.rm=TRUE))
-<?		}
-		if (getRK_val ("mad")) { ?>
-	rk.temp.results$'Median Absolute Deviation'[i] <- try (mad (eval (rk.temp.var), constant = <? echo ($constMad);
-			if ($mad_type == "low") echo (", low=TRUE");
-			elseif ($mad_type == "high") echo (", high=TRUE"); ?>, na.rm=TRUE))
-<?		}
-		if (getRK_val ("length")) { ?>
-	rk.temp.results$'length of sample'[i] <- try (length (eval (rk.temp.var)))
-<?		}
-		if (getRK_val ("nacount")) { ?>
-	rk.temp.results$'number of NAs'[i] <- try (length (which(is.na(eval (rk.temp.var)))))
-<?		} ?>
-}<?
-	}
-	
-	function printout () {
-		global $mad_type;
-		global $constMad;
-?>
-rk.header ("Descriptive statistics", parameters=list ("Trim of mean", <?getRK ("trim") ;?><? if (getRK_val ("mad")) { ?>,
-					"Median Absolute Deviation",
-					paste ("constant:", <?echo ($constMad) ;?>, <?
-						if ($mad_type == "low") echo ('"lo-median"');
-						elseif ($mad_type == '"hi-median"');
-						else echo ('"average"'); ?>)<? } ?>))
-
-rk.results (rk.temp.results)
-<?
-	}
-	
-	function cleanup () {
-?>
-rm (list=grep ("^rk.temp", ls (), value=TRUE))
-<?
-	}
-?>

Deleted: trunk/rkward/rkward/plugins/20descriptive/description.xml
===================================================================
--- trunk/rkward/rkward/plugins/20descriptive/description.xml	2007-01-05 11:50:20 UTC (rev 1064)
+++ trunk/rkward/rkward/plugins/20descriptive/description.xml	2007-01-05 12:03:22 UTC (rev 1065)
@@ -1,60 +0,0 @@
-<!DOCTYPE rkplugin>
-<!-- This is a simple example, of how a "plugin" might be configured. -->
-<document>
-	<code file="code.php" />
-	<dialog label="Descriptive Statistics" >
-		<tabbook>
-			<tab label="Variables">
-				<row>
-					<column>
-						<varselector id="vars" />
-					</column>
-					<column>
-						<varslot multi="true" type="numeric" source="vars" id="x" num_dimensions="1" label="variable(s):" required="true" />
-					</column>
-				</row>
-			</tab>
-			<tab label="Mean Standard Deviation">				
-				<column>
-					<checkbox value_unchecked="0" checked="true" value="1" id="mean" label="mean" />
-					<spinbox type="real" initial="0" min="0" id="trim" max="0.5" label="trim" />
-				</column>
-				<column>
-					<checkbox value_unchecked="0" checked="true" value="1" id="sd" label="standard deviation" />
-				</column>
-				<stretch/>
-			</tab>
-			<tab label="Median, MAD">
-				<column>
-					<frame label="Median, Range" >
-						<checkbox value_unchecked="0" value="1" id="median" label="median" />
-					</frame>
-					<frame label="Median Absolute Deviation (mad)" >
-						<checkbox value_unchecked="0" value="1" id="mad" label="mad" />
-						<spinbox type="real" initial="1.4628" id="constMad" label="Constant" />
-						<radio id="mad_type" label="Treatment of even sample sizes" >
-							<option value="low" label="use lo-median" />
-							<option value="average" label="use average" checked="true" />
-							<option value="high" label="use hi-median" />
-						</radio>
-					</frame>
-					<stretch/>
-				</column>
-			</tab>
-			<tab label="Range, Sum, Product and Length">
-				<row>
-					<column>
-						<frame>
-							<checkbox value_unchecked="0" checked="true" value="1" id="range" label="range" />
-							<checkbox value_unchecked="0" value="1" id="sum" label="sum" />
-							<checkbox value_unchecked="0" value="1" id="prod" label="prod" />
-							<checkbox value_unchecked="0" value="1" id="length" label="length" />
-							<checkbox value_unchecked="0" value="1" id="nacount" label="Na count" />
-						</frame>
-						<stretch/>
-					</column>
-				</row>
-			</tab>
-		</tabbook>
-	</dialog>
-</document>

Copied: trunk/rkward/rkward/plugins/20descriptive/descriptive_statistics.php (from rev 1064, trunk/rkward/rkward/plugins/20descriptive/code.php)
===================================================================
--- trunk/rkward/rkward/plugins/20descriptive/descriptive_statistics.php	                        (rev 0)
+++ trunk/rkward/rkward/plugins/20descriptive/descriptive_statistics.php	2007-01-05 12:03:22 UTC (rev 1065)
@@ -0,0 +1,78 @@
+<?
+	function preprocess () {
+	}
+	
+	function calculate () {
+		global $mad_type;
+		global $constMad;
+
+		$vars = "substitute (" . str_replace ("\n", "), substitute (", trim (getRK_val ("x"))) . ")";
+		$trim = getRK_val ("trim"); //the fraction (0 to 0.5) of observations to be trimmed from each end of x before the mean is computed
+		$constMad = getRK_val ("constMad");
+		$mad_type = getRK_val ("mad_type");
+
+?>
+rk.temp.vars <- list (<? echo ($vars); ?>)
+rk.temp.results <- data.frame ('Object'=rep (NA, length (rk.temp.vars)))
+i=0;
+for (rk.temp.var in rk.temp.vars) {
+	i = i+1
+	rk.temp.results$'Object'[i] <- rk.get.description (rk.temp.var, is.substitute=TRUE)
+<?
+		if (getRK_val ("mean")) { ?>
+	rk.temp.results$mean[i] <- try (mean (eval (rk.temp.var), trim = <?echo ($trim) ;?>, na.rm=TRUE))
+<?		}
+		if (getRK_val ("median")) { ?>
+	rk.temp.results$median[i] <- try (median (eval (rk.temp.var), na.rm=TRUE))
+<?		}
+		if (getRK_val ("range")) { ?>
+	try ({
+		rk.temp.range <- try (range (eval (rk.temp.var), na.rm=TRUE))
+		rk.temp.results$min[i] <- rk.temp.range[1]
+		rk.temp.results$max[i] <- rk.temp.range[2]
+	})
+<?		}
+		if (getRK_val ("sd")) { ?>
+	rk.temp.results$'standard deviation'[i] <- try (sd (eval (rk.temp.var), na.rm=TRUE))
+<?		}
+		if (getRK_val ("sum")) { ?>
+	rk.temp.results$sum[i] <- try (sum (eval (rk.temp.var), na.rm=TRUE))
+<?		}
+		if (getRK_val ("prod")) { ?>
+	rk.temp.results$prod[i] <- try (prod (eval (rk.temp.var), na.rm=TRUE))
+<?		}
+		if (getRK_val ("mad")) { ?>
+	rk.temp.results$'Median Absolute Deviation'[i] <- try (mad (eval (rk.temp.var), constant = <? echo ($constMad);
+			if ($mad_type == "low") echo (", low=TRUE");
+			elseif ($mad_type == "high") echo (", high=TRUE"); ?>, na.rm=TRUE))
+<?		}
+		if (getRK_val ("length")) { ?>
+	rk.temp.results$'length of sample'[i] <- try (length (eval (rk.temp.var)))
+<?		}
+		if (getRK_val ("nacount")) { ?>
+	rk.temp.results$'number of NAs'[i] <- try (length (which(is.na(eval (rk.temp.var)))))
+<?		} ?>
+}<?
+	}
+	
+	function printout () {
+		global $mad_type;
+		global $constMad;
+?>
+rk.header ("Descriptive statistics", parameters=list ("Trim of mean", <?getRK ("trim") ;?><? if (getRK_val ("mad")) { ?>,
+					"Median Absolute Deviation",
+					paste ("constant:", <?echo ($constMad) ;?>, <?
+						if ($mad_type == "low") echo ('"lo-median"');
+						elseif ($mad_type == '"hi-median"');
+						else echo ('"average"'); ?>)<? } ?>))
+
+rk.results (rk.temp.results)
+<?
+	}
+	
+	function cleanup () {
+?>
+rm (list=grep ("^rk.temp", ls (), value=TRUE))
+<?
+	}
+?>

Copied: trunk/rkward/rkward/plugins/20descriptive/descriptive_statistics.xml (from rev 1059, trunk/rkward/rkward/plugins/20descriptive/description.xml)
===================================================================
--- trunk/rkward/rkward/plugins/20descriptive/descriptive_statistics.xml	                        (rev 0)
+++ trunk/rkward/rkward/plugins/20descriptive/descriptive_statistics.xml	2007-01-05 12:03:22 UTC (rev 1065)
@@ -0,0 +1,60 @@
+<!DOCTYPE rkplugin>
+<!-- This is a simple example, of how a "plugin" might be configured. -->
+<document>
+	<code file="descriptive_statistics.php" />
+	<dialog label="Descriptive Statistics" >
+		<tabbook>
+			<tab label="Variables">
+				<row>
+					<column>
+						<varselector id="vars" />
+					</column>
+					<column>
+						<varslot multi="true" type="numeric" source="vars" id="x" num_dimensions="1" label="variable(s):" required="true" />
+					</column>
+				</row>
+			</tab>
+			<tab label="Mean Standard Deviation">				
+				<column>
+					<checkbox value_unchecked="0" checked="true" value="1" id="mean" label="mean" />
+					<spinbox type="real" initial="0" min="0" id="trim" max="0.5" label="trim" />
+				</column>
+				<column>
+					<checkbox value_unchecked="0" checked="true" value="1" id="sd" label="standard deviation" />
+				</column>
+				<stretch/>
+			</tab>
+			<tab label="Median, MAD">
+				<column>
+					<frame label="Median, Range" >
+						<checkbox value_unchecked="0" value="1" id="median" label="median" />
+					</frame>
+					<frame label="Median Absolute Deviation (mad)" >
+						<checkbox value_unchecked="0" value="1" id="mad" label="mad" />
+						<spinbox type="real" initial="1.4628" id="constMad" label="Constant" />
+						<radio id="mad_type" label="Treatment of even sample sizes" >
+							<option value="low" label="use lo-median" />
+							<option value="average" label="use average" checked="true" />
+							<option value="high" label="use hi-median" />
+						</radio>
+					</frame>
+					<stretch/>
+				</column>
+			</tab>
+			<tab label="Range, Sum, Product and Length">
+				<row>
+					<column>
+						<frame>
+							<checkbox value_unchecked="0" checked="true" value="1" id="range" label="range" />
+							<checkbox value_unchecked="0" value="1" id="sum" label="sum" />
+							<checkbox value_unchecked="0" value="1" id="prod" label="prod" />
+							<checkbox value_unchecked="0" value="1" id="length" label="length" />
+							<checkbox value_unchecked="0" value="1" id="nacount" label="Na count" />
+						</frame>
+						<stretch/>
+					</column>
+				</row>
+			</tab>
+		</tabbook>
+	</dialog>
+</document>

Modified: trunk/rkward/rkward/plugins/Makefile.am
===================================================================
--- trunk/rkward/rkward/plugins/Makefile.am	2007-01-05 11:50:20 UTC (rev 1064)
+++ trunk/rkward/rkward/plugins/Makefile.am	2007-01-05 12:03:22 UTC (rev 1065)
@@ -147,10 +147,10 @@
 
 pluginsX20descriptivedir = $(kde_datadir)/rkward/20descriptive
 dist_pluginsX20descriptive_DATA = \
-	20descriptive/code.php \
-	20descriptive/description.xml \
 	20descriptive/skewness_kurtosis_test.xml \
-	20descriptive/skewness_kurtosis_test.php
+	20descriptive/skewness_kurtosis_test.php \
+	20descriptive/descriptive_statistics.xml \
+	20descriptive/descriptive_statistics.php
 
 pluginsXcorrUmatrixdir = $(kde_datadir)/rkward/corr_matrix
 dist_pluginsXcorrUmatrix_DATA = \

Modified: trunk/rkward/rkward/plugins/all.pluginmap
===================================================================
--- trunk/rkward/rkward/plugins/all.pluginmap	2007-01-05 11:50:20 UTC (rev 1064)
+++ trunk/rkward/rkward/plugins/all.pluginmap	2007-01-05 12:03:22 UTC (rev 1065)
@@ -16,7 +16,7 @@
 		<component type="standard" id="plots_scatterplot" file="plots/scatterplot.xml" label="Scatterplot" />
 		<component type="standard" id="plot_options" file="plots/plot_options.xml" label="Plot Options" />
 
-		<component type="standard" id="descriptive" file="20descriptive/description.xml" label="Descriptive Statistics" />
+		<component type="standard" id="descriptive" file="20descriptive/descriptive_statistics.xml" label="Descriptive Statistics" />
 		<component type="standard" id="corr_matrix" file="corr_matrix/description.xml" label="Correlation Matrix" />
 		<component type="standard" id="simple_anova" file="simple_anova/description.xml" label="Simple Anova" />
 		<component type="standard" id="basic_statistics" file="uni1.2/description.xml" label="Basic Statistics" />

Modified: trunk/rkward/rkward/plugins/uni1.2/description.xml
===================================================================
--- trunk/rkward/rkward/plugins/uni1.2/description.xml	2007-01-05 11:50:20 UTC (rev 1064)
+++ trunk/rkward/rkward/plugins/uni1.2/description.xml	2007-01-05 12:03:22 UTC (rev 1065)
@@ -1,6 +1,6 @@
 <!DOCTYPE rkplugin>
 <!-- This is a simple example, of how a "plugin" might be configured. --><document>
-	<code file="code.php"/>
+	<code file="descriptive_statistics.php"/>
 	<logic>
 		<connect client="constMad.enabled" governor="mad.state" />
 		<connect client="pourcent.enabled" governor="trim.state" />


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