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

tfry at users.sourceforge.net tfry at users.sourceforge.net
Wed Apr 27 18:02:08 UTC 2011


Revision: 3532
          http://rkward.svn.sourceforge.net/rkward/?rev=3532&view=rev
Author:   tfry
Date:     2011-04-27 18:02:07 +0000 (Wed, 27 Apr 2011)

Log Message:
-----------
Update boxplot auto-test, and add test for grouped data mode.

Modified Paths:
--------------
    trunk/rkward/ChangeLog
    trunk/rkward/tests/plots/RKTestStandard.boxplot.rkcommands.R
    trunk/rkward/tests/plots.R

Added Paths:
-----------
    trunk/rkward/tests/plots/RKTestStandard.boxplot_grouped.rkcommands.R
    trunk/rkward/tests/plots/RKTestStandard.boxplot_grouped.rkout

Modified: trunk/rkward/ChangeLog
===================================================================
--- trunk/rkward/ChangeLog	2011-04-27 11:56:34 UTC (rev 3531)
+++ trunk/rkward/ChangeLog	2011-04-27 18:02:07 UTC (rev 3532)
@@ -1,4 +1,4 @@
-- Box plot plugin gains supported for grouped outcome data
+- Box plot plugin gains support for grouped outcome data
 - Fixed: Pressing Ctrl+C would not reset syntactically incomplete commands in the R console
 - Crosstabs N to 1 plugin gains options to compute proportions and margins (thanks to Andrés Necochea)		TODO: update / add automated test(s)
 - Added convenience R function rk.list() to allow simplification of plugin code		# TODO: ideally, this should be used in all applicable plugins

Modified: trunk/rkward/tests/plots/RKTestStandard.boxplot.rkcommands.R
===================================================================
--- trunk/rkward/tests/plots/RKTestStandard.boxplot.rkcommands.R	2011-04-27 11:56:34 UTC (rev 3531)
+++ trunk/rkward/tests/plots/RKTestStandard.boxplot.rkcommands.R	2011-04-27 18:02:07 UTC (rev 3532)
@@ -2,12 +2,12 @@
 ## Prepare
 ## Compute
 ## Print result
-data_list <- list (women[["weight"]], women[["height"]])		#convert single sample variables to list
-rk.header ("Boxplot", list ("Variable(s)", rk.get.description (women[["weight"]], women[["height"]], paste.sep=", ")))
+data_list <- rk.list (women[["weight"]], women[["height"]])		#convert single sample variables to list
+rk.header ("Boxplot", list ("Variable(s)", paste (names (data_list), collapse=", ")))
 rk.graph.on()
 try (boxplot (data_list, notch = FALSE, outline = TRUE, horizontal = FALSE)) #actuall boxplot function
 	try (points(sapply(data_list,mean,na.rm = TRUE),pch=15, cex = 1.00, col="blue")) #calculates the mean for all data and adds a point at the corresponding position
 rk.graph.off ()
 })
-.rk.rerun.plugin.link(plugin="rkward::box_plot", settings="cex_sd_mean.real=1.00\nmean.state=TRUE\nnames_exp.text=names (x)\nnames_mode.string=default\nnotch.state=FALSE\norientation.string=FALSE\noutline.state=TRUE\npch_mean.real=15.00\nplotoptions.add_grid.state=0\nplotoptions.asp.real=0.00\nplotoptions.main.text=\nplotoptions.pointcolor.color.string=\nplotoptions.pointtype.string=\nplotoptions.sub.text=\nplotoptions.xaxt.state=\nplotoptions.xlab.text=\nplotoptions.xlog.state=\nplotoptions.xmaxvalue.text=\nplotoptions.xminvalue.text=\nplotoptions.yaxt.state=\nplotoptions.ylab.text=\nplotoptions.ylog.state=\nplotoptions.ymaxvalue.text=\nplotoptions.yminvalue.text=\nsd.state=\nsd_mean_color.color.string=blue\nx.available=women[[\\\"weight\\\"]]\\nwomen[[\\\"height\\\"]]", label="Run again")
+.rk.rerun.plugin.link(plugin="rkward::box_plot", settings="cex_sd_mean.real=1.00\ndata_mode.string=separate_vars\ngroups.available=\nmean.state=TRUE\nnames_exp.text=names (x)\nnames_mode.string=default\nnotch.state=FALSE\norientation.string=FALSE\noutcome.available=\noutline.state=TRUE\npch_mean.real=15.00\nplotoptions.add_grid.state=0\nplotoptions.asp.real=0.00\nplotoptions.main.text=\nplotoptions.pointcolor.color.string=\nplotoptions.pointtype.string=\nplotoptions.sub.text=\nplotoptions.xaxt.state=\nplotoptions.xlab.text=\nplotoptions.xlog.state=\nplotoptions.xmaxvalue.text=\nplotoptions.xminvalue.text=\nplotoptions.yaxt.state=\nplotoptions.ylab.text=\nplotoptions.ylog.state=\nplotoptions.ymaxvalue.text=\nplotoptions.yminvalue.text=\nsd.state=\nsd_mean_color.color.string=blue\nx.available=women[[\\\"weight\\\"]]\\nwomen[[\\\"height\\\"]]", label="Run again")
 .rk.make.hr()

Added: trunk/rkward/tests/plots/RKTestStandard.boxplot_grouped.rkcommands.R
===================================================================
--- trunk/rkward/tests/plots/RKTestStandard.boxplot_grouped.rkcommands.R	                        (rev 0)
+++ trunk/rkward/tests/plots/RKTestStandard.boxplot_grouped.rkcommands.R	2011-04-27 18:02:07 UTC (rev 3532)
@@ -0,0 +1,13 @@
+local({
+## Prepare
+## Compute
+## Print result
+groups <- rk.list (warpbreaks[["tension"]], warpbreaks[["wool"]])
+data_list <- split (warpbreaks[["breaks"]], groups)		#split sample by grouping variables
+rk.header ("Boxplot", list ("Outcome variable", rk.get.description (warpbreaks[["breaks"]]), "Grouping variable(s)", paste (names (groups), collapse=", ")))
+rk.graph.on()
+try (boxplot (data_list, notch = FALSE, outline = FALSE, horizontal = TRUE)) #actuall boxplot function
+rk.graph.off ()
+})
+.rk.rerun.plugin.link(plugin="rkward::box_plot", settings="data_mode.string=grouped_outcome\ngroups.available=warpbreaks[[\\\"tension\\\"]]\\nwarpbreaks[[\\\"wool\\\"]]\nmean.state=\nnames_exp.text=names (x)\nnames_mode.string=default\nnotch.state=FALSE\norientation.string=TRUE\noutcome.available=warpbreaks[[\\\"breaks\\\"]]\noutline.state=FALSE\nplotoptions.add_grid.state=0\nplotoptions.asp.real=0.00\nplotoptions.main.text=\nplotoptions.pointcolor.color.string=\nplotoptions.pointtype.string=\nplotoptions.sub.text=\nplotoptions.xaxt.state=\nplotoptions.xlab.text=\nplotoptions.xlog.state=\nplotoptions.xmaxvalue.text=\nplotoptions.xminvalue.text=\nplotoptions.yaxt.state=\nplotoptions.ylab.text=\nplotoptions.ylog.state=\nplotoptions.ymaxvalue.text=\nplotoptions.yminvalue.text=\nsd.state=\nx.available=datasets::women[[\\\"weight\\\"]]\\ndatasets::women[[\\\"height\\\"]]", label="Run again")
+.rk.make.hr()

Added: trunk/rkward/tests/plots/RKTestStandard.boxplot_grouped.rkout
===================================================================
--- trunk/rkward/tests/plots/RKTestStandard.boxplot_grouped.rkout	                        (rev 0)
+++ trunk/rkward/tests/plots/RKTestStandard.boxplot_grouped.rkout	2011-04-27 18:02:07 UTC (rev 3532)
@@ -0,0 +1,7 @@
+<h1>Boxplot</h1>
+<h2>Parameters</h2>
+<ul><li>Outcome variable: breaks</li>
+<li>Grouping variable(s): tension, wool</li>
+</ul>
+DATE<br>
+<img src="graph.png" width="480" height="480"><br>

Modified: trunk/rkward/tests/plots.R
===================================================================
--- trunk/rkward/tests/plots.R	2011-04-27 11:56:34 UTC (rev 3531)
+++ trunk/rkward/tests/plots.R	2011-04-27 18:02:07 UTC (rev 3532)
@@ -25,6 +25,9 @@
 		new ("RKTest", id="boxplot", call=function () {
 			rk.call.plugin ("rkward::box_plot", cex_sd_mean.real="1.00", mean.state="TRUE", names_exp.text="names (x)", names_mode.string="default", notch.state="FALSE", orientation.string="FALSE", outline.state="TRUE", pch_mean.real="15.", plotoptions.add_grid.state="0", plotoptions.asp.real="0.00", plotoptions.main.text="", plotoptions.pointcolor.color.string="", plotoptions.pointtype.string="", plotoptions.sub.text="", plotoptions.xaxt.state="", plotoptions.xlab.text="", plotoptions.xlog.state="", plotoptions.xmaxvalue.text="", plotoptions.xminvalue.text="", plotoptions.yaxt.state="", plotoptions.ylab.text="", plotoptions.ylog.state="", plotoptions.ymaxvalue.text="", plotoptions.yminvalue.text="", sd.state="", sd_mean_color.color.string="blue", x.available="women[[\"weight\"]]\nwomen[[\"height\"]]", submit.mode="submit")
 		}),
+		new ("RKTest", id="boxplot_grouped", call=function () {
+			rk.call.plugin ("rkward::box_plot", data_mode.string="grouped_outcome", groups.available="warpbreaks[[\"tension\"]]\nwarpbreaks[[\"wool\"]]", mean.state="", names_exp.text="names (x)", names_mode.string="default", notch.state="FALSE", orientation.string="TRUE", outcome.available="warpbreaks[[\"breaks\"]]", outline.state="FALSE", plotoptions.add_grid.state="0", plotoptions.asp.real="0.00", plotoptions.main.text="", plotoptions.pointcolor.color.string="", plotoptions.pointtype.string="", plotoptions.sub.text="", plotoptions.xaxt.state="", plotoptions.xlab.text="", plotoptions.xlog.state="", plotoptions.xmaxvalue.text="", plotoptions.xminvalue.text="", plotoptions.yaxt.state="", plotoptions.ylab.text="", plotoptions.ylog.state="", plotoptions.ymaxvalue.text="", plotoptions.yminvalue.text="", sd.state="", x.available="datasets::women[[\"weight\"]]\ndatasets::women[[\"height\"]]", submit.mode="submit")
+		}),
 		new ("RKTest", id="density_plot", call=function () {
 			rk.call.plugin ("rkward::density_plot", adjust.real="1.00", bw.string="nrd0", kern.string="gaussian", n.real="512.00", narm.state="na.rm=TRUE", plot_type.string="hdr_plot", plotoptions.add_grid.state="0", plotoptions.asp.real="0.00", plotoptions.main.text="", plotoptions.pointcolor.color.string="", plotoptions.pointtype.string="", plotoptions.sub.text="", plotoptions.xaxt.state="", plotoptions.xlab.text="", plotoptions.xlog.state="", plotoptions.xmaxvalue.text="", plotoptions.xminvalue.text="", plotoptions.yaxt.state="", plotoptions.ylab.text="", plotoptions.ylog.state="", plotoptions.ymaxvalue.text="", plotoptions.yminvalue.text="", rug.state="0", x.available="women[[\"height\"]]", submit.mode="submit")
 		}, libraries = c ("hdrcde")),


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