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

tfry at users.sourceforge.net tfry at users.sourceforge.net
Tue Sep 25 10:28:14 UTC 2012


Revision: 4306
          http://rkward.svn.sourceforge.net/rkward/?rev=4306&view=rev
Author:   tfry
Date:     2012-09-25 10:28:13 +0000 (Tue, 25 Sep 2012)
Log Message:
-----------
Update boxplot tests and standards

Modified Paths:
--------------
    trunk/rkward/tests/plots/boxplot.rkcommands.R
    trunk/rkward/tests/plots/boxplot.rkout
    trunk/rkward/tests/plots/boxplot_grouped.rkcommands.R
    trunk/rkward/tests/plots.R

Modified: trunk/rkward/tests/plots/boxplot.rkcommands.R
===================================================================
--- trunk/rkward/tests/plots/boxplot.rkcommands.R	2012-09-25 08:28:41 UTC (rev 4305)
+++ trunk/rkward/tests/plots/boxplot.rkcommands.R	2012-09-25 10:28:13 UTC (rev 4306)
@@ -3,7 +3,25 @@
 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)) #actual 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
+try ({
+	boxplot (data_list, notch = FALSE, outline = TRUE, horizontal = FALSE) #actual boxplot function
+	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 ()
 })
+local({
+## Print result
+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) #actual boxplot function
+	geo_mean <- function (x) {prod(na.omit(x))^(1/length(na.omit(x)))}	#Calculate geometric mean
+	points(sapply(data_list, geo_mean), pch=15, cex = 1.00, col="blue") #calculates the mean for all data and adds a point at the corresponding position
+	sd_low <- (sapply(data_list, mean, na.rm = TRUE)) - (sapply(data_list,sd,na.rm = TRUE))
+	sd_high <- (sapply(data_list, mean, na.rm = TRUE)) + (sapply(data_list,sd,na.rm = TRUE))
+	points(sd_low, pch=3, cex = 1.00, col="blue")
+	points(sd_high, pch=3, cex = 1.00, col="blue")
+})
+rk.graph.off ()
+})

Modified: trunk/rkward/tests/plots/boxplot.rkout
===================================================================
--- trunk/rkward/tests/plots/boxplot.rkout	2012-09-25 08:28:41 UTC (rev 4305)
+++ trunk/rkward/tests/plots/boxplot.rkout	2012-09-25 10:28:13 UTC (rev 4306)
@@ -4,3 +4,9 @@
 </ul>
 DATE<br />
 <img src="graph.png" width="480" height="480"><br>
+<h1>Boxplot</h1>
+<h2>Parameters</h2>
+<ul><li>Variable(s): weight, height</li>
+</ul>
+DATE<br />
+<img src="graph.png" width="480" height="480"><br>

Modified: trunk/rkward/tests/plots/boxplot_grouped.rkcommands.R
===================================================================
--- trunk/rkward/tests/plots/boxplot_grouped.rkcommands.R	2012-09-25 08:28:41 UTC (rev 4305)
+++ trunk/rkward/tests/plots/boxplot_grouped.rkcommands.R	2012-09-25 10:28:13 UTC (rev 4306)
@@ -4,19 +4,23 @@
 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)) #actual boxplot function
+try ({
+	boxplot (data_list, notch = FALSE, outline = FALSE, horizontal = TRUE) #actual boxplot function
+})
 rk.graph.off ()
 })
 local({
 ## Print result
-groups <- rk.list (datasets::warpbreaks[["tension"]], datasets::warpbreaks[["wool"]])
-data_list <- split (datasets::warpbreaks[["breaks"]], groups)		#split sample by grouping variables
+groups <- rk.list (warpbreaks[["tension"]], warpbreaks[["wool"]])
+data_list <- split (warpbreaks[["breaks"]], groups)		#split sample by grouping variables
 # adjust width and position of boxes to achieve dodging
-dodge_size <- nlevels (interaction (datasets::warpbreaks[["tension"]]))
+dodge_size <- nlevels (interaction (warpbreaks[["tension"]]))
 box_width <- 0.80 / dodge_size
 box_positions <- (rep (1:(length (data_list) / dodge_size), each=dodge_size) + (1:dodge_size)*(box_width))
-rk.header ("Boxplot", list ("Outcome variable", rk.get.description (datasets::warpbreaks[["breaks"]]), "Grouping variable(s)", paste (names (groups), collapse=", ")))
+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, boxwex=box_width, at=box_positions, xlim=c(min(box_positions)-box_width, max(box_positions)+box_width), notch = FALSE, outline = FALSE, horizontal = TRUE)) #actual boxplot function
+try ({
+	boxplot (data_list, boxwex=box_width, at=box_positions, xlim=c(min(box_positions)-box_width, max(box_positions)+box_width), notch = FALSE, outline = FALSE, horizontal = TRUE) #actual boxplot function
+})
 rk.graph.off ()
 })

Modified: trunk/rkward/tests/plots.R
===================================================================
--- trunk/rkward/tests/plots.R	2012-09-25 08:28:41 UTC (rev 4305)
+++ trunk/rkward/tests/plots.R	2012-09-25 10:28:13 UTC (rev 4306)
@@ -30,9 +30,9 @@
 			rk.call.plugin ("rkward::box_plot", boxwex.real="0.80", cex_sd_mean.real="1.00", data_mode.string="separate_vars", mean.checked="1", names_mode.string="default", notch.state="FALSE", orientation.string="FALSE", outline.state="TRUE", pch_mean.real="15.00", pch_sd_high.real="3.00", pch_sd_low.real="3.00", plotoptions.add_grid.state="0", plotoptions.asp.real="0.00", plotoptions.cexaxis.text="", plotoptions.main.text="", plotoptions.pointcolor.color.string="", plotoptions.pointtype.string="", plotoptions.sub.text="", plotoptions.ticklblrot.string="", plotoptions.xaxt.state="", plotoptions.xlab.text="", plotoptions.yaxt.state="", plotoptions.ylab.text="", plotoptions.ymaxvalue.text="", plotoptions.yminvalue.text="", sd.checked="1", sd_mean_color.color.string="blue", type_of_mean.string="geometric_mean", 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")
+			rk.call.plugin ("rkward::box_plot", boxwex.real="0.80", data_mode.string="grouped_outcome", dodges.real="0.00", groups.available="warpbreaks[[\"tension\"]]\nwarpbreaks[[\"wool\"]]", mean.checked="0", 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.cexaxis.text="", plotoptions.main.text="", plotoptions.pointcolor.color.string="", plotoptions.pointtype.string="", plotoptions.sub.text="", plotoptions.ticklblrot.string="", plotoptions.xaxt.state="", plotoptions.xlab.text="", plotoptions.yaxt.state="", plotoptions.ylab.text="", plotoptions.ymaxvalue.text="", plotoptions.yminvalue.text="", sd.checked="0", submit.mode="submit")
 
-			rk.call.plugin ("rkward::box_plot", boxwex.real="0.80", data_mode.string="grouped_outcome", dodges.real="1.00", groups.available="datasets::warpbreaks[[\"tension\"]]\ndatasets::warpbreaks[[\"wool\"]]", mean.state="", names_mode.string="default", notch.state="FALSE", orientation.string="TRUE", outcome.available="datasets::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.yaxt.state="", plotoptions.ylab.text="", plotoptions.ymaxvalue.text="", plotoptions.yminvalue.text="", sd.state="", submit.mode="submit")
+			rk.call.plugin ("rkward::box_plot", boxwex.real="0.80", data_mode.string="grouped_outcome", dodges.real="1.00", groups.available="warpbreaks[[\"tension\"]]\nwarpbreaks[[\"wool\"]]", mean.checked="0", 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.cexaxis.text="", plotoptions.main.text="", plotoptions.pointcolor.color.string="", plotoptions.pointtype.string="", plotoptions.sub.text="", plotoptions.ticklblrot.string="", plotoptions.xaxt.state="", plotoptions.xlab.text="", plotoptions.yaxt.state="", plotoptions.ylab.text="", plotoptions.ymaxvalue.text="", plotoptions.yminvalue.text="", sd.checked="0", submit.mode="submit")
 		}),
 		new ("RKTest", id="density_plot", call=function () {
 			# Get rid of the warning about results differing from R < 2.2 from sample()

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