[rkward-cvs] SF.net SVN: rkward:[4424] branches/external_plugins/rk.ANOVA

m-eik at users.sourceforge.net m-eik at users.sourceforge.net
Thu Nov 8 21:31:33 UTC 2012


Revision: 4424
          http://rkward.svn.sourceforge.net/rkward/?rev=4424&view=rev
Author:   m-eik
Date:     2012-11-08 21:31:33 +0000 (Thu, 08 Nov 2012)
Log Message:
-----------
rk.ANOVA: began work on testsuite

Modified Paths:
--------------
    branches/external_plugins/rk.ANOVA/ChangeLog
    branches/external_plugins/rk.ANOVA/DESCRIPTION
    branches/external_plugins/rk.ANOVA/inst/rkward/plugins/ANOVA.xml
    branches/external_plugins/rk.ANOVA/inst/rkward/plugins/Interactionplot.js
    branches/external_plugins/rk.ANOVA/inst/rkward/plugins/Interactionplot.xml
    branches/external_plugins/rk.ANOVA/inst/rkward/plugins/PairwisetTests.xml
    branches/external_plugins/rk.ANOVA/inst/rkward/plugins/Preparewithinsubjectdata.js
    branches/external_plugins/rk.ANOVA/inst/rkward/plugins/Preparewithinsubjectdata.xml
    branches/external_plugins/rk.ANOVA/inst/rkward/rk.ANOVA.pluginmap
    branches/external_plugins/rk.ANOVA/inst/rkward/rkwarddev_ANOVA_plugin_script.R

Added Paths:
-----------
    branches/external_plugins/rk.ANOVA/inst/rkward/tests/
    branches/external_plugins/rk.ANOVA/inst/rkward/tests/rk.ANOVA/
    branches/external_plugins/rk.ANOVA/inst/rkward/tests/testsuite.R

Modified: branches/external_plugins/rk.ANOVA/ChangeLog
===================================================================
--- branches/external_plugins/rk.ANOVA/ChangeLog	2012-11-08 17:49:56 UTC (rev 4423)
+++ branches/external_plugins/rk.ANOVA/ChangeLog	2012-11-08 21:31:33 UTC (rev 4424)
@@ -1,5 +1,11 @@
 ChangeLog for package rk.ANOVA
 
+changes in version 0.01-14 (2012-11-08)
+added:
+  - plugin tests
+changed:
+  - preparing/reshaping data now shows a summary of the result
+
 changes in version 0.01-13 (2012-09-29)
 fixed:
   - added generic pre/post plot options

Modified: branches/external_plugins/rk.ANOVA/DESCRIPTION
===================================================================
--- branches/external_plugins/rk.ANOVA/DESCRIPTION	2012-11-08 17:49:56 UTC (rev 4423)
+++ branches/external_plugins/rk.ANOVA/DESCRIPTION	2012-11-08 21:31:33 UTC (rev 4424)
@@ -1,23 +1,18 @@
 Package: rk.ANOVA
 Type: Package
-Title: RKWard GUI to conduct ANOVAs (using the ez package), pairwise t-Tests
-    and plot interactions.
-Version: 0.01-13
-Date: 2012-09-29
+Title: RKWard GUI to conduct ANOVAs (using the ez package), pairwise
+        t-Tests and plot interactions.
+Version: 0.01-14
+Date: 2012-11-08
 Author: Meik Michalke <meik.michalke at hhu.de>
 Maintainer: Meik Michalke <meik.michalke at hhu.de>
-Depends:
-    rkward (>= 0.5.6)
-Suggests:
-    ez,
-    sciplot
+Depends: rkward (>= 0.5.6)
+Suggests: ez, sciplot
 Enhances: rkward
-Description: RKWard GUI to conduct ANOVAs (using the ez package), pairwise
-    t-Tests and plot interactions.
+Description: RKWard GUI to conduct ANOVAs (using the ez package),
+        pairwise t-Tests and plot interactions.
 License: GPL (>= 3)
 LazyLoad: yes
 URL: http://rkward.sf.net
 Authors at R: person(given="Meik", family="Michalke",
-    email="meik.michalke at hhu.de", role=c("aut", "cre"))
-Collate:
-    'rk.ANOVA-package.R'
+        email="meik.michalke at hhu.de", role=c("aut", "cre"))

Modified: branches/external_plugins/rk.ANOVA/inst/rkward/plugins/ANOVA.xml
===================================================================
--- branches/external_plugins/rk.ANOVA/inst/rkward/plugins/ANOVA.xml	2012-11-08 17:49:56 UTC (rev 4423)
+++ branches/external_plugins/rk.ANOVA/inst/rkward/plugins/ANOVA.xml	2012-11-08 21:31:33 UTC (rev 4424)
@@ -1,4 +1,4 @@
-<!DOCTYPE rkplugin>
+<!DOCTYPE rkplugin >
 <document>
 	<!-- this code was generated using the rkwarddev package.
 			perhaps don't make changes here, but in the rkwarddev script instead! -->
@@ -23,7 +23,7 @@
 		<connect governor="lgc_vvars" client="vrsl_Wthnsbjc.visible" />
 		<connect governor="lgc_bvars" client="vrsl_Btwnsbjc.required" />
 		<connect governor="lgc_vvars" client="vrsl_Wthnsbjc.required" />
-		<connect governor="lgc_vrslDtms" client="row_vSSOTOOTOO.enabled" />
+		<connect governor="lgc_vrslDtms" client="row_vSSOTOTOTO.enabled" />
 		<connect governor="vrsl_Dtmstbdt.available" client="vrs_Slctbsrv.root" />
 	</logic>
 	<dialog label="ANOVA">
@@ -54,10 +54,10 @@
 				</row>
 			</tab>
 			<tab label="Observed" id="tab_Observed">
-				<row id="row_vSSOTOOTOO">
+				<row id="row_vSSOTOTOTO">
 					<varselector id="vrs_Slctbsrv" label="Select observed variables" />
-					<column id="clm_fOTOOTOOOS">
-						<frame id="frm_txtdtxtOTO">
+					<column id="clm_fOTOTOTOTO">
+						<frame id="frm_txtdtxOTOT">
 							<text id="txt_ObsrvdvT">
 								Observed variables are independent variables you have 								<b>
 									already defined
@@ -65,6 +65,7 @@
 								as either between or within variables, but that were measured and 								<b>
 									not manipulated
 								</b>
+								. They affect the calculated effect size (generalized eta seqared).
 							</text>
 						</frame>
 						<frame id="frm_vrsltdvOOS">

Modified: branches/external_plugins/rk.ANOVA/inst/rkward/plugins/Interactionplot.js
===================================================================
--- branches/external_plugins/rk.ANOVA/inst/rkward/plugins/Interactionplot.js	2012-11-08 17:49:56 UTC (rev 4423)
+++ branches/external_plugins/rk.ANOVA/inst/rkward/plugins/Interactionplot.js	2012-11-08 21:31:33 UTC (rev 4424)
@@ -41,9 +41,9 @@
 	}
 
 	// in case there are generic plot options defined:
-	var embGnrcpltpCodePreprocess = getValue("emb_Gnrcpltp.code.preprocess");
-	var embGnrcpltpCodePrintout = getValue("emb_Gnrcpltp.code.printout");
-	var embGnrcpltpCodeCalculate = getValue("emb_Gnrcpltp.code.calculate");
+	var embRkwrdpltptnGCodePreprocess = getValue("emb_rkwrdpltptnG.code.preprocess");
+	var embRkwrdpltptnGCodePrintout = getValue("emb_rkwrdpltptnG.code.printout");
+	var embRkwrdpltptnGCodeCalculate = getValue("emb_rkwrdpltptnG.code.calculate");
 
 	if(full) {
 		echo("rk.graph.on()\n");
@@ -51,7 +51,7 @@
 	echo("\ttry({\n");
 
 	// insert any option-setting code that should be run before the actual plotting commands:
-	printIndentedUnlessEmpty("\t\t", embGnrcpltpCodePreprocess, "\n", "");
+	printIndentedUnlessEmpty("\t\t", embRkwrdpltptnGCodePreprocess, "\n", "");
 
 	// the actual plot:
 	if(radPlottype == "line") {
@@ -86,11 +86,11 @@
 	if(!chcStndrdrr) {
 		echo(",\n\t\t\tci.fun=function(x)c(mean(x, na.rm=TRUE), mean(x, na.rm=TRUE))");
 	}
-	echo(embGnrcpltpCodePrintout.replace(/, /g, ",\n\t\t\t"));
+	echo(embRkwrdpltptnGCodePrintout.replace(/, /g, ",\n\t\t\t"));
 	echo(")");
 
 	// insert any option-setting code that should be run after the actual plot:
-	printIndentedUnlessEmpty("\t\t", embGnrcpltpCodeCalculate, "\n", "");
+	printIndentedUnlessEmpty("\t\t", embRkwrdpltptnGCodeCalculate, "\n", "");
 
 	echo("\n\t})\n");
 	if(full) {

Modified: branches/external_plugins/rk.ANOVA/inst/rkward/plugins/Interactionplot.xml
===================================================================
--- branches/external_plugins/rk.ANOVA/inst/rkward/plugins/Interactionplot.xml	2012-11-08 17:49:56 UTC (rev 4423)
+++ branches/external_plugins/rk.ANOVA/inst/rkward/plugins/Interactionplot.xml	2012-11-08 21:31:33 UTC (rev 4424)
@@ -1,4 +1,4 @@
-<!DOCTYPE rkplugin>
+<!DOCTYPE rkplugin >
 <document>
 	<!-- this code was generated using the rkwarddev package.
 			perhaps don't make changes here, but in the rkwarddev script instead! -->
@@ -13,9 +13,9 @@
 		<connect governor="lgc_vrslGrpn" client="chc_Legend.enabled" />
 		<convert id="lgc_lgcvrsGL" sources="lgc_vrslGrpn;chc_Legend.state" mode="and" />
 		<connect governor="lgc_lgcvrsGL" client="inp_Legndlbl.enabled" />
-		<connect governor="vrsl_Factrxxs.available" client="emb_Gnrcpltp.xvar" />
-		<connect governor="vrsl_Rspnsvct.available" client="emb_Gnrcpltp.yvar" />
-		<set id="emb_Gnrcpltp.allow_type" to="false" />
+		<connect governor="vrsl_Factrxxs.available" client="emb_rkwrdpltptnG.xvar" />
+		<connect governor="vrsl_Rspnsvct.available" client="emb_rkwrdpltptnG.yvar" />
+		<set id="emb_rkwrdpltptnG.allow_type" to="false" />
 	</logic>
 	<dialog label="Interaction plot">
 		<row id="row_vSSDDFFSRR">
@@ -52,7 +52,7 @@
 						</column>
 					</row>
 					<input label="Legend label" id="inp_Legndlbl" />
-					<embed component="rkward::plot_options" as_button="true" label="Generic plot options" id="emb_Gnrcpltp" />
+					<embed component="rkward::plot_options" as_button="true" label="Generic plot options" id="emb_rkwrdpltptnG" />
 					<preview />
 				</frame>
 			</column>

Modified: branches/external_plugins/rk.ANOVA/inst/rkward/plugins/PairwisetTests.xml
===================================================================
--- branches/external_plugins/rk.ANOVA/inst/rkward/plugins/PairwisetTests.xml	2012-11-08 17:49:56 UTC (rev 4423)
+++ branches/external_plugins/rk.ANOVA/inst/rkward/plugins/PairwisetTests.xml	2012-11-08 21:31:33 UTC (rev 4424)
@@ -1,4 +1,4 @@
-<!DOCTYPE rkplugin>
+<!DOCTYPE rkplugin >
 <document>
 	<!-- this code was generated using the rkwarddev package.
 			perhaps don't make changes here, but in the rkwarddev script instead! -->

Modified: branches/external_plugins/rk.ANOVA/inst/rkward/plugins/Preparewithinsubjectdata.js
===================================================================
--- branches/external_plugins/rk.ANOVA/inst/rkward/plugins/Preparewithinsubjectdata.js	2012-11-08 17:49:56 UTC (rev 4423)
+++ branches/external_plugins/rk.ANOVA/inst/rkward/plugins/Preparewithinsubjectdata.js	2012-11-08 21:31:33 UTC (rev 4424)
@@ -69,7 +69,7 @@
 	// printout the results
 	echo("rk.header(\"Prepare within subject data results\")\n");
 
-
+	echo("\trk.print(summary(anova.data))\n");
 	//// save result object
 	// read in saveobject variables
 	var svbSvrsltst = getValue("svb_Svrsltst");

Modified: branches/external_plugins/rk.ANOVA/inst/rkward/plugins/Preparewithinsubjectdata.xml
===================================================================
--- branches/external_plugins/rk.ANOVA/inst/rkward/plugins/Preparewithinsubjectdata.xml	2012-11-08 17:49:56 UTC (rev 4423)
+++ branches/external_plugins/rk.ANOVA/inst/rkward/plugins/Preparewithinsubjectdata.xml	2012-11-08 21:31:33 UTC (rev 4424)
@@ -1,4 +1,4 @@
-<!DOCTYPE rkplugin>
+<!DOCTYPE rkplugin >
 <document>
 	<!-- this code was generated using the rkwarddev package.
 			perhaps don't make changes here, but in the rkwarddev script instead! -->

Modified: branches/external_plugins/rk.ANOVA/inst/rkward/rk.ANOVA.pluginmap
===================================================================
--- branches/external_plugins/rk.ANOVA/inst/rkward/rk.ANOVA.pluginmap	2012-11-08 17:49:56 UTC (rev 4423)
+++ branches/external_plugins/rk.ANOVA/inst/rkward/rk.ANOVA.pluginmap	2012-11-08 21:31:33 UTC (rev 4424)
@@ -1,4 +1,4 @@
-<!DOCTYPE rkpluginmap>
+<!DOCTYPE rkpluginmap >
 <document 
 	namespace="rkward"
 	id="ANOVA_rkward"
@@ -11,8 +11,8 @@
 		name="rk.ANOVA"
 		shortinfo="RKWard GUI to conduct ANOVAs (using the ez package), pairwise t-Tests and plot interactions."
 		longinfo="RKWard GUI to conduct ANOVAs (using the ez package), pairwise t-Tests and plot interactions."
-		version="0.01-13"
-		releasedate="2012-09-29"
+		version="0.01-14"
+		releasedate="2012-11-08"
 		url="http://rkward.sf.net"
 		license="GPL (>= 3)"
 	>

Modified: branches/external_plugins/rk.ANOVA/inst/rkward/rkwarddev_ANOVA_plugin_script.R
===================================================================
--- branches/external_plugins/rk.ANOVA/inst/rkward/rkwarddev_ANOVA_plugin_script.R	2012-11-08 17:49:56 UTC (rev 4423)
+++ branches/external_plugins/rk.ANOVA/inst/rkward/rkwarddev_ANOVA_plugin_script.R	2012-11-08 21:31:33 UTC (rev 4424)
@@ -5,7 +5,7 @@
 
 local({
 # set the output directory to overwrite the actual plugin
-output.dir <- tempdir()
+#output.dir <- tempdir()
 overwrite <- TRUE
 
 require(rkwarddev)
@@ -16,7 +16,7 @@
 		person(given="Meik", family="Michalke",
 			email="meik.michalke at hhu.de", role=c("aut","cre"))),
 	about=list(desc="RKWard GUI to conduct ANOVAs (using the ez package), pairwise t-Tests and plot interactions.",
-		version="0.01-13", url="http://rkward.sf.net"),
+		version="0.01-14", url="http://rkward.sf.net"),
 	dependencies=list(rkward.min="0.5.6"),
 	package=list(c(name="ez"), c(name="sciplot"))
 	)
@@ -126,18 +126,18 @@
 	jsVarWithin <- rk.JS.vars(var.within, modifiers="shortname", join=", "),
 	jsVarBetween <- rk.JS.vars(var.between, modifiers="shortname", join=", "),
 	jsVarObserved <- rk.JS.vars(var.observed, modifiers="shortname", join=", "),
-	ite(rkwarddev:::id(drp.vtype, " == 3"), echo("\t# set contrasts for accurate type 3 ANOVA\n\toptions(contrasts=c(\"contr.sum\",\"contr.poly\"))\n")),
-	ite(rkwarddev:::id(var.wid, " == \"\" & ", anova.drp.design, " == \"between\""), echo("\t# ezANOVA demands a subject identifier variable\n\t", var.data, " <- cbind(", var.data ,", ez.subject.ID.dummy=factor(1:nrow(", var.data ,")))\n")),
+	ite(rkwarddev::id(drp.vtype, " == 3"), echo("\t# set contrasts for accurate type 3 ANOVA\n\toptions(contrasts=c(\"contr.sum\",\"contr.poly\"))\n")),
+	ite(rkwarddev::id(var.wid, " == \"\" & ", anova.drp.design, " == \"between\""), echo("\t# ezANOVA demands a subject identifier variable\n\t", var.data, " <- cbind(", var.data ,", ez.subject.ID.dummy=factor(1:nrow(", var.data ,")))\n")),
 	echo("\tanova.results <- ezANOVA("),
 	ite(var.data, echo("\n\t\tdata=", var.data)),
 	ite(var.dv, echo(",\n\t\tdv=.(", jsVarDv ,")")),
-	ite(var.wid, echo(",\n\t\twid=.(", jsVarWid ,")"), ite(rkwarddev:::id(anova.drp.design, " == \"between\""), echo(",\n\t\twid=.(ez.subject.ID.dummy)"))), # wid is needed anyway
-	ite(rkwarddev:::id(var.within, " != \"\" & ", anova.drp.design, " != \"between\""), echo(",\n\t\twithin=.(", jsVarWithin ,")")),
-	ite(rkwarddev:::id(var.between, " != \"\" & ", anova.drp.design, " != \"within\""), echo(",\n\t\tbetween=.(", jsVarBetween ,")")),
+	ite(var.wid, echo(",\n\t\twid=.(", jsVarWid ,")"), ite(rkwarddev::id(anova.drp.design, " == \"between\""), echo(",\n\t\twid=.(ez.subject.ID.dummy)"))), # wid is needed anyway
+	ite(rkwarddev::id(var.within, " != \"\" & ", anova.drp.design, " != \"between\""), echo(",\n\t\twithin=.(", jsVarWithin ,")")),
+	ite(rkwarddev::id(var.between, " != \"\" & ", anova.drp.design, " != \"within\""), echo(",\n\t\tbetween=.(", jsVarBetween ,")")),
 	ite(var.observed, echo(",\n\t\tobserved=.(", jsVarObserved ,")")),
 
-	ite(rkwarddev:::id(drp.vtype, " != 2"), echo(",\n\t\ttype=", drp.vtype)),
-	ite(rkwarddev:::id(drp.white, " != \"false\""), echo(",\n\t\twhite.adjust=\"", drp.white, "\"")),
+	ite(rkwarddev::id(drp.vtype, " != 2"), echo(",\n\t\ttype=", drp.vtype)),
+	ite(rkwarddev::id(drp.white, " != \"false\""), echo(",\n\t\twhite.adjust=\"", drp.white, "\"")),
 	tf(check.extrainfo, opt="detailed"),
 	tf(check.aov, opt="return_aov"),
 	echo(")\n\n"),
@@ -217,7 +217,7 @@
 		echo("\tnum.cases <- nrow(", pd.var.data,")\n"),
 		rk.paste.JS(
 			echo("\tnum.cases <- unique(sapply(list(\n\t\t\t", pd.js.dep),
-			ite(id("!", pd.chk.genCaseID , " && ", pd.var.wid),
+			ite(rkwarddev::id("!", pd.chk.genCaseID , " && ", pd.var.wid),
 				echo(",\n\t\t\t", pd.var.wid)),
 			ite(pd.var.between,
 				echo(",\n\t\t\t", pd.js.between)),
@@ -227,7 +227,7 @@
 	),
 	ite(pd.var.dependent, echo("\tanova.conditions <- c(\"", pd.js.dep.names, "\")\n\tnum.conditions <- length(anova.conditions)\n\n")),
 	ite(pd.var.between,
-		rkwarddev:::id("\tvar betweenVarsNames = ", pd.js.between.short, ".split(\"\\n\");\n",
+		rkwarddev::id("\tvar betweenVarsNames = ", pd.js.between.short, ".split(\"\\n\");\n",
 		"\tvar betweenVars = ", pd.var.between, ".split(\"\\n\");"),
 			"\tvar betweenVars = \"\";"),
 	echo("\tanova.data <- data.frame("),
@@ -235,11 +235,11 @@
 		echo("\n\t\t", pd.inp.dependent, "=c(\n\t\t\t", pd.js.dep, ")",
 		",\n\t\t", pd.inp.condition, "=factor(rep(anova.conditions, each=num.cases))")
 	),
-	ite(id(pd.chk.genCaseID , " && ", pd.inp.caseID),
+	ite(rkwarddev::id(pd.chk.genCaseID , " && ", pd.inp.caseID),
 		echo(",\n\t\t", pd.inp.caseID, "=factor(rep(1:num.cases, times=num.conditions))")),
-	ite(id("!", pd.chk.genCaseID , " && ", pd.var.wid),
+	ite(rkwarddev::id("!", pd.chk.genCaseID , " && ", pd.var.wid),
 		echo(",\n\t\t", pd.js.wid, "=factor(rep(", pd.var.wid, ", times=num.conditions))")),
-	ite(pd.var.between, rkwarddev:::id("\tfor (var i=0, len=betweenVarsNames.length; i<len; ++i ){\n",
+	ite(pd.var.between, rkwarddev::id("\tfor (var i=0, len=betweenVarsNames.length; i<len; ++i ){\n",
 		"\t\t\techo(\",\\n\\t\\t\" + betweenVarsNames[i] + \"=factor(rep(\" + betweenVars[i] + \", times=num.conditions))\");\n",
 		"\t\t}"
 	)),
@@ -247,14 +247,18 @@
 	empty.e=TRUE
 )
 
+pd.js.print <- rk.paste.JS(
+	echo("\trk.print(summary(anova.data))\n")
+)
+
 ## make a whole component of the data preparation
 pdata.component <- rk.plugin.component("Prepare within subject data",
 	xml=list(
 		logic=pd.lgc.sect,
 		dialog=pd.full.dialog),
  	js=list(
- 		calculate=pd.js.calc),
-# 		printout=pd.js.print),
+ 		calculate=pd.js.calc,
+ 		printout=pd.js.print),
 	hierarchy=list("data", "ANOVA"),
 	create=c("xml", "js"))
 
@@ -320,7 +324,7 @@
 
 ## JavaScript
 pt.js.calc <- rk.paste.JS(
-	ite(rkwarddev:::id(pt.data.format, " == \"one\""),
+	ite(rkwarddev::id(pt.data.format, " == \"one\""),
 		rk.paste.JS(
 			echo("\tpair.t.results <- pairwise.t.test(\n\t\t"),
 			ite(pt.tvar.data, echo("x=", pt.tvar.data)),
@@ -336,7 +340,7 @@
 	ite(pt.drp.adjust, echo(",\n\t\tp.adjust.method=\"", pt.drp.adjust, "\"")),
 	tf(pt.chk.poolSD, opt="pool.sd"),
 	tf(pt.chk.paired, opt="paired"),
-	ite(rkwarddev:::id(pt.radio.altern, " != \"two.sided\""), echo(",\n\t\talternative=\"", pt.radio.altern, "\"")),
+	ite(rkwarddev::id(pt.radio.altern, " != \"two.sided\""), echo(",\n\t\talternative=\"", pt.radio.altern, "\"")),
 	echo(")\n\n"),
 	empty.e=TRUE
 )
@@ -414,19 +418,19 @@
 
 ## JavaScript
 ip.js.prnt <- 	rk.paste.JS.graph(
-	ite(rkwarddev:::id(ip.rad.plottype, " == \"line\""),
+	ite(rkwarddev::id(ip.rad.plottype, " == \"line\""),
 		echo("\t\tlineplot.CI("),
 		echo("\t\tbargraph.CI(")),
 	ite(ip.tvar.x, echo("\n\t\t\tx.factor=", ip.tvar.x)),
 	ite(ip.tvar.response, echo(",\n\t\t\tresponse=", ip.tvar.response)),
 	ite(ip.tvar.group, echo(",\n\t\t\tgroup=", ip.tvar.group)),
-	ite(rkwarddev:::id(ip.rad.plottype, " == \"line\" & ", ip.rad.ltype, " != \"b\""), echo(",\n\t\t\ttype=\"", ip.rad.ltype, "\"")),
-	ite(rkwarddev:::id(ip.rad.plottype, " == \"bar\" & ", ip.rad.btype, " == \"split\""), echo(",\n\t\t\tsplit=TRUE")),
-	ite(rkwarddev:::id(ip.rad.plottype, " == \"line\" & !", ip.chk.legend, " & ", ip.tvar.group, " != \"\""), echo(",\n\t\t\tlegend=FALSE")),
-	ite(rkwarddev:::id(ip.rad.plottype, " == \"bar\" & ", ip.chk.legend, " == \"true\" & ", ip.tvar.group, " != \"\""), echo(",\n\t\t\tlegend=TRUE")),
-	ite(rkwarddev:::id(ip.chk.legend, " == \"true\" & ", ip.tvar.group, " != \"\" & ", ip.inp.trace.label, " != \"\""), echo(",\n\t\t\ttrace.label=\"", ip.inp.trace.label, "\"")),
-	ite(rkwarddev:::id("!", ip.chk.se), echo(",\n\t\t\tci.fun=function(x)c(mean(x, na.rm=TRUE), mean(x, na.rm=TRUE))")),
-	id("echo(", ip.plot.options, ".replace(/, /g, \",\\n\\t\\t\\t\"));"),
+	ite(rkwarddev::id(ip.rad.plottype, " == \"line\" & ", ip.rad.ltype, " != \"b\""), echo(",\n\t\t\ttype=\"", ip.rad.ltype, "\"")),
+	ite(rkwarddev::id(ip.rad.plottype, " == \"bar\" & ", ip.rad.btype, " == \"split\""), echo(",\n\t\t\tsplit=TRUE")),
+	ite(rkwarddev::id(ip.rad.plottype, " == \"line\" & !", ip.chk.legend, " & ", ip.tvar.group, " != \"\""), echo(",\n\t\t\tlegend=FALSE")),
+	ite(rkwarddev::id(ip.rad.plottype, " == \"bar\" & ", ip.chk.legend, " == \"true\" & ", ip.tvar.group, " != \"\""), echo(",\n\t\t\tlegend=TRUE")),
+	ite(rkwarddev::id(ip.chk.legend, " == \"true\" & ", ip.tvar.group, " != \"\" & ", ip.inp.trace.label, " != \"\""), echo(",\n\t\t\ttrace.label=\"", ip.inp.trace.label, "\"")),
+	ite(rkwarddev::id("!", ip.chk.se), echo(",\n\t\t\tci.fun=function(x)c(mean(x, na.rm=TRUE), mean(x, na.rm=TRUE))")),
+	rkwarddev::id("echo(", ip.plot.options, ".replace(/, /g, \",\\n\\t\\t\\t\"));"),
 	echo(")"),
 	plotOpts=ip.plot.options
 )

Added: branches/external_plugins/rk.ANOVA/inst/rkward/tests/testsuite.R
===================================================================
--- branches/external_plugins/rk.ANOVA/inst/rkward/tests/testsuite.R	                        (rev 0)
+++ branches/external_plugins/rk.ANOVA/inst/rkward/tests/testsuite.R	2012-11-08 21:31:33 UTC (rev 4424)
@@ -0,0 +1,43 @@
+## definition of the test suite
+	suite <- new("RKTestSuite",
+		id="rk.ANOVA",
+		## needed packages
+		libraries = c("rk.ANOVA"),
+		## initCalls are run *before* any tests. Use this to set up the environment
+		initCalls = list(
+			function(){
+				## load needed packages
+				require("ez")
+
+				## prepare needed data objects
+				sample.data.frame <- data.frame(
+					subjects=1:30, cond1=31:60, cond2=131:160
+				)
+			},
+			function(){
+				## if some tests depend on results of earlier tests,
+				## you can store those in a list in .GlobalEnv
+				earlier.results <<- list()
+			}
+		),
+		## the tests
+		tests = list(
+				## define the actual tests here
+				new("RKTest", id="prepare.data", call=function(){
+					rk.call.plugin ("rkward::cmp_ANOVAPreparewithinsbjctdt", chc_Atmtccss.state="", inp_Nmfrdpnd.text="response", inp_Nmfrxprm.text="condition", svb_Svrsltst.active="1", svb_Svrsltst.objectname="anova.data", svb_Svrsltst.parent=".GlobalEnv", vrsl_Btwnsbjc.available="", vrsl_Cssbjctd.available="sample.data.frame[[\"subjects\"]]", vrsl_Dpndntrs.available="sample.data.frame[[\"cond1\"]]\nsample.data.frame[[\"cond2\"]]", vrsl_Slctllvr.available="sample.data.frame", submit.mode="submit")
+				## to store these results:
+				earlier.results$anova.data <<- anova.data
+				}),
+				new("RKTest", id="ANOVA", call=function(){
+				anova.data <- earlier.results$anova.data 
+					rk.call.plugin ("rkward::cmp_ANOVAANOVA", chc_Rtrnvbjc.state="true", chc_Shwsmsfs.state="true", chc_Spprsspc.state="true", drp_Htrscdst.string="false", drp_Smsfsqrs.string="2", rad_Design.string="within", svb_Svrsltst.active="0", svb_Svrsltst.objectname="anova.results", svb_Svrsltst.parent=".GlobalEnv", vrsl_Cssbjctd.available="anova.data[[\"subjects\"]]", vrsl_Dpndntvr.available="anova.data[[\"response\"]]", vrsl_Dtmstbdt.available="anova.data", vrsl_Obsrvdvr.available="", vrsl_Wthnsbjc.available="anova.data[[\"condition\"]]", submit.mode="submit")
+				})
+		),
+		## postCalls are like initCalls, but run after all tests to clean up.
+		postCalls = list(
+			function(){
+				## e.g. remove created objects
+				rm(list=c("earlier.results"), envir=globalenv())
+			}
+		)
+	)
\ No newline at end of file

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