[rkward-cvs] SF.net SVN: rkward:[3369] branches/jss_dec_10/examples

tfry at users.sourceforge.net tfry at users.sourceforge.net
Thu Jan 20 16:11:41 UTC 2011


Revision: 3369
          http://rkward.svn.sourceforge.net/rkward/?rev=3369&view=rev
Author:   tfry
Date:     2011-01-20 16:11:41 +0000 (Thu, 20 Jan 2011)

Log Message:
-----------
Add more demos and a README file. Plugin files still need to be added.

Modified Paths:
--------------
    branches/jss_dec_10/examples/demo.R

Added Paths:
-----------
    branches/jss_dec_10/examples/README.txt
    branches/jss_dec_10/examples/experiment.txt
    branches/jss_dec_10/examples/plugin_demo/

Added: branches/jss_dec_10/examples/README.txt
===================================================================
--- branches/jss_dec_10/examples/README.txt	                        (rev 0)
+++ branches/jss_dec_10/examples/README.txt	2011-01-20 16:11:41 UTC (rev 3369)
@@ -0,0 +1,25 @@
+-- Requirements for this demonstration --
+These demonstration files require an existing installation of RKWard 0.5.4 on your
+system. Please refer to http://rkward.sf.net for instructions on the various
+methods of installation.
+
+-- Replicating examples and figures from Sections 3, 4, and 5 --
+To replicate the examples and figures from Sections 3, 4, and 5 of the article,
+source or paste the script 'demo.R' contained in the same directory as this file,
+*inside an RKWard session*. Assuming that the rkward binary is in your system's
+search path, you can also run
+   rkward --evaluate "source ('demo.R')"
+from within the directory containing this file.
+
+Note that since most examples/figures are concerned with interactive GUI
+elements, the demonstraction script runs interactively as well, and will prompt
+you to perform certain user actions, which cannot (meaningfully) be scripted.
+
+-- Plugin example from Section 6 --
+Section 6 of the article shows how to extend RKWard by a custom plugin. The
+required files are included in the sub-directory 'plugin_demo' contained in the
+same directory as this file. To activate these, start an RKWard session, and select
+Settings->Configure RKWard->Plugins from the menu. Add the file
+plugin_demo/demo.pluginmap to the list of .pluginmap files.
+
+Note that the official RKWard distribution already contains a t-test plugin.

Modified: branches/jss_dec_10/examples/demo.R
===================================================================
--- branches/jss_dec_10/examples/demo.R	2011-01-20 14:44:24 UTC (rev 3368)
+++ branches/jss_dec_10/examples/demo.R	2011-01-20 16:11:41 UTC (rev 3369)
@@ -45,6 +45,7 @@
 
 ## Figure 7
 graphics.off ()
+rk.clear.plot.history ()
 plot (rnorm (50))
 data_rnorm <- rnorm (50)
 boxplot (data_rnorm)
@@ -67,3 +68,45 @@
 <b>Note</b>: You may need to adjust the path to the file 'experiment.txt', which we provided in the same directory
 as the demo script.<br>
 Click 'Submit' when done. <b>Note</b>: Subsequent demos require this data, so <b>do</b> click 'Submit'.")
+
+
+## Figure 10
+rk.call.plugin ("rkward::t_test_two_vars", confint.state="1", conflevel.real="0.95", hypothesis.string="less", paired.state="1", x.available="experiment.data[[\"before\"]]", y.available="experiment.data[[\"after\"]]", submit.mode="manual")
+ok.to.proceed ("<b>Replication of Figure 10</b>: Dialog for t-test on imported data.</br>
+<b>Note</b>: The results (Figure 10B) will appear in the output window after clicking 'Submit'.<br>")
+
+
+## Figure 11
+rk.call.plugin ("rkward::box_plot", mean.state="", names_custom.text="T1;T2", names_exp.text="names (x)", names_mode.string="custom", notch.state="FALSE", orientation.string="FALSE", outline.state="TRUE", 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="experiment.data[[\"before\"]]\nexperiment.data[[\"after\"]]", submit.mode="manual")
+ok.to.proceed ("<b>Replication of Figure 11</b>: Dialog for box plot of imported data.</br>
+<b>Note</b>: To follow the text of the article, you can check the 'Preview'-box, here, but this is not required for this demo. Click 'Close' when done.<br>")
+
+
+## Figure 12
+data_list <- experiment.data
+names (data_list) <- c ("T1", "T2")
+boxplot (data_list, notch = FALSE, outline = TRUE, horizontal = FALSE)
+ok.to.proceed ("<b>Replication of Figure 12</b>: Box plot of imported data.</br>
+Select Device->Export... to bring up the dialog shown in Figure 12 (not accessible programmatically).<br>")
+
+
+## Section 5.2
+rk.show.message ("<b>Code listing in Section 5.2</b>.<br>The following demo runs the code listing in section 5.2
+of the article. First, we run the example that <b>is</b> subject to object modification detection.
+On typical systems, this will take several seconds to complete.")
+i <- 1
+rk.sync.global ()	# Needed to trigger object modification detection without returning to the toplevel command prompt
+for (i in 1:100000) i+i
+rk.show.message ("<b>Code listing in Section 5.2</b>.<br>Next, we run the example that <b>is not</b> subject to object modification detection, but performs equivalent computations. This should finish nearly instantaneuously.")
+f <- function () {
+	i <- 1
+	for (i in 1:100000) i+i
+}
+f ()
+
+
+## Done
+rk.show.message ("<b>Finished</b>.<br>This demo has finished.<br>
+<b>Note</b> that the example plugin shown in section 6 cannot be wrapped into this demo script in a meaningful
+way. For instructions on replicating this example, see the README.txt file which we provided in the same directory
+as this demo script.")

Added: branches/jss_dec_10/examples/experiment.txt
===================================================================
--- branches/jss_dec_10/examples/experiment.txt	                        (rev 0)
+++ branches/jss_dec_10/examples/experiment.txt	2011-01-20 16:11:41 UTC (rev 3369)
@@ -0,0 +1,21 @@
+"before","after"
+"1",2.59881668817252,6.27938165864907
+"2",4.07322714105248,3.54498200886883
+"3",3.81693699024618,6.65626962389797
+"4",1.57162503339350,5.61035546311177
+"5",1.42704263795167,6.58266940689646
+"6",1.90141262393445,4.88719239784405
+"7",4.51673570461571,3.56738872313872
+"8",4.63976163044572,3.17273762961850
+"9",3.81835013255477,7.55779400654137
+"10",4.31393549032509,6.12445039628074
+"11",3.23106218222529,7.29057926521637
+"12",3.26707640662789,7.59672255907208
+"13",4.9570998288691,3.58348488877527
+"14",4.18278214335442,3.1944324770011
+"15",1.15126007888466,3.19534041988663
+"16",3.90166653227061,7.6175876702182
+"17",3.53701809793711,3.96727746771649
+"18",4.28850199189037,5.24918448948301
+"19",2.02426377404481,4.94558601593599
+"20",2.0060713943094,3.7008952985052


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