[rkward] rkward/plugins/rkwarddev_scripts: Work in progress: Add basic preview feature to Power Analysis plugin.

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Tue Jan 26 11:42:52 UTC 2016


Git commit 272dc5830373f601b152cf9647697db500450724 by Thomas Friedrichsmeier.
Committed on 26/01/2016 at 08:10.
Pushed by tfry into branch 'master'.

Work in progress: Add basic preview feature to Power Analysis plugin.

M  +18   -10   rkward/plugins/rkwarddev_scripts/rkwarddev_power_plugin_script.R

http://commits.kde.org/rkward/272dc5830373f601b152cf9647697db500450724

diff --git a/rkward/plugins/rkwarddev_scripts/rkwarddev_power_plugin_script.R b/rkward/plugins/rkwarddev_scripts/rkwarddev_power_plugin_script.R
index 85d65c8..7a75d8e 100644
--- a/rkward/plugins/rkwarddev_scripts/rkwarddev_power_plugin_script.R
+++ b/rkward/plugins/rkwarddev_scripts/rkwarddev_power_plugin_script.R
@@ -4,7 +4,7 @@
 # *EXCEPT* for the last call, see below.
 
 require(rkwarddev)
-rkwarddev.required("0.07-4")
+rkwarddev.required("0.08-2")
 
 local({
 # set the output directory to overwrite the actual plugin
@@ -18,7 +18,7 @@ about.info <- rk.XML.about(
       email="meik.michalke at hhu.de", role=c("aut","cre")),
     person(given="Thomas", family="Friedrichsmeier", email="thomas.friedrichsmeier at ruhr-uni-bochum.de", role=c("ctb"))),
   about=list(desc="RKWard GUI to perform power analysis and sample size estimation.",
-    version="0.02-1", url="http://rkward.kde.org")
+    version="0.03-1", url="http://rkward.kde.org")
   )
 dependencies.info <- rk.XML.dependencies(
   dependencies=list(rkward.min="0.6.3",
@@ -142,7 +142,10 @@ tab.pwr.data <- rk.XML.row(
         pwr.effect.etasq.rad,
         label="Statistical Method"
       ),
-      rk.XML.stretch()
+      rk.XML.stretch(),
+      rk.XML.frame (
+        rk.XML.preview (mode="output")
+      )
     ),
     rk.XML.col(
       rk.XML.frame(
@@ -479,12 +482,16 @@ pwr.js.print <- rk.paste.JS(
     "\t\treturn()\n\t}\n\n"),
   R.comment ("Prepare printout"),
   echo ("\tnote <- pwr.result[[\"note\"]]\n"),
-  id ("header = new Header ().addFromUI (\"", pwr.parameter.rad, "\");\n", js=FALSE),
-  echo ("\tparameters <- list("),
-  "echo (header.extractParameters ());",
-  echo (")\n",
-    "\tif(!is.null(pwr.result[[\"alternative\"]])){\n\t\tparameters[[", i18n ("alternative"), "]] <- pwr.result[[\"alternative\"]]\n\t}\n\n",
-    "\trk.header(pwr.result[[\"method\"]], parameters=parameters)\n",
+  js (if ("!is_preview") {
+    id ("header = new Header ().addFromUI (\"", pwr.parameter.rad, "\");\n", js=FALSE,
+    echo ("\tparameters <- list("),
+    "echo (header.extractParameters ());",
+    echo (")\n",
+      "\tif(!is.null(pwr.result[[\"alternative\"]])){\n\t\tparameters[[", i18n ("alternative"), "]] <- pwr.result[[\"alternative\"]]\n\t}\n\n",
+      "\trk.header(pwr.result[[\"method\"]], parameters=parameters)\n"
+    ))
+   }),
+  echo (
     "\tpwr.result[c(\"method\", \"note\", \"alternative\")] <- NULL\n",
     "\tpwr.result <- as.data.frame(unlist(pwr.result))\n",
     "\tcolnames(pwr.result) <- ", i18n ("Parameters"), "\n\n",
@@ -546,7 +553,8 @@ pwr.plugin.dir <<- rk.plugin.skeleton(
   js=list(results.header=FALSE,
     require="pwr",
     calculate=pwr.js.calc,
-    printout=pwr.js.print),
+    printout=pwr.js.print,
+    preview=TRUE),
   rkh=list(
     summary=pwr.rkh.summary,
     usage=pwr.rkh.usage,



More information about the rkward-tracker mailing list