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

tfry at users.sf.net tfry at users.sf.net
Mon Mar 18 17:52:35 UTC 2013


Revision: 4608
          http://sourceforge.net/p/rkward/code/4608
Author:   tfry
Date:     2013-03-18 17:52:34 +0000 (Mon, 18 Mar 2013)
Log Message:
-----------
Add plugin test for subset plugin

Modified Paths:
--------------
    trunk/rkward/ChangeLog
    trunk/rkward/rkward/plugins/rkwarddev_scripts/subset_dataframe.R
    trunk/rkward/rkward/wrapper/rkward_startup_wrapper.cpp
    trunk/rkward/tests/data_plugin_tests.R

Added Paths:
-----------
    trunk/rkward/tests/data_plugin_tests/subset_dataframe.rkcommands.R

Modified: trunk/rkward/ChangeLog
===================================================================
--- trunk/rkward/ChangeLog	2013-03-18 10:54:36 UTC (rev 4607)
+++ trunk/rkward/ChangeLog	2013-03-18 17:52:34 UTC (rev 4608)
@@ -1,3 +1,4 @@
+- Add plugin for subsetting data.frames by rows or columns
 - On the Windows platform, add an new (experimental) binary startup wrapper (rkward.exe)
 - Revert to building R packages form source on Mac OS X by default (controllable via compile-time option)
 - Fixed: lattice plots would not be added to the plot history, correctly, for some versions of lattice

Modified: trunk/rkward/rkward/plugins/rkwarddev_scripts/subset_dataframe.R
===================================================================
--- trunk/rkward/rkward/plugins/rkwarddev_scripts/subset_dataframe.R	2013-03-18 10:54:36 UTC (rev 4607)
+++ trunk/rkward/rkward/plugins/rkwarddev_scripts/subset_dataframe.R	2013-03-18 17:52:34 UTC (rev 4608)
@@ -5,10 +5,7 @@
 
 ## Plugin mandatory TODO
 #
-# - write .rkh
 # - testing!
-# - write automated tests
-# - ChangeLog entry
 
 ## Plugin wishlist
 #

Modified: trunk/rkward/rkward/wrapper/rkward_startup_wrapper.cpp
===================================================================
--- trunk/rkward/rkward/wrapper/rkward_startup_wrapper.cpp	2013-03-18 10:54:36 UTC (rev 4607)
+++ trunk/rkward/rkward/wrapper/rkward_startup_wrapper.cpp	2013-03-18 17:52:34 UTC (rev 4608)
@@ -152,7 +152,7 @@
 		if (r_exe.isNull ()) {
 			r_exe = R_EXECUTABLE;
 			if (!QFileInfo (r_exe).isExecutable ()) {
-				QMessageBox::critical (0, "Specified R executable does not exist", QString ("The R executable specified at compile time (%1) does not exist or is not executable. Probably the installation of R has moved. You can use the command line parameter '--R', or supply and rkward.ini file to specify the new location.").arg (r_exe));
+				QMessageBox::critical (0, "Specified R executable does not exist", QString ("The R executable specified at compile time (%1) does not exist or is not executable. Probably the installation of R has moved. You can use the command line parameter '--R', or supply an rkward.ini file to specify the new location.").arg (r_exe));
 				exit (1);
 			}
 		}

Added: trunk/rkward/tests/data_plugin_tests/subset_dataframe.rkcommands.R
===================================================================
--- trunk/rkward/tests/data_plugin_tests/subset_dataframe.rkcommands.R	                        (rev 0)
+++ trunk/rkward/tests/data_plugin_tests/subset_dataframe.rkcommands.R	2013-03-18 17:52:34 UTC (rev 4608)
@@ -0,0 +1,11 @@
+local({
+## Compute
+	sset.result <- subset(
+		sleep,
+		((extra >= 0) & (extra < 3)) & (group == 1),
+		select=c (extra, ID)
+	)
+
+## Print result
+.GlobalEnv$sset.result <- sset.result
+})

Modified: trunk/rkward/tests/data_plugin_tests.R
===================================================================
--- trunk/rkward/tests/data_plugin_tests.R	2013-03-18 10:54:36 UTC (rev 4607)
+++ trunk/rkward/tests/data_plugin_tests.R	2013-03-18 17:52:34 UTC (rev 4608)
@@ -8,6 +8,7 @@
 			# prepare some different files for loading
 			library ("datasets")
 			data (women)
+			data (sleep)
 		}
 	## the tests
 	), tests = list (
@@ -18,6 +19,9 @@
 			rk.call.plugin ("rkward::sort_data", conversion.string="as is", multi_sortby.serialized="keys=women.backup[[\\\"height\\\"]]\n_row=conversion.string=as is\treverse.state=1", object.available="women.backup", order.string="", saveto_select.string="same", sortby.available="women.backup[[\"height\"]]", submit.mode="submit")
 
 			stopifnot (all.equal (women.backup, women[order (-women$height),]))
+		}),
+		new ("RKTest", id="subset_dataframe", call=function () {
+			rk.call.plugin ("rkward::subset_dataframe", drp_fltr_num.string="range", frm_Onlyssbs.checked="1", inp_Exprssnr.text="group == 1", inp_Mnmmrmpt.text="0", inp_Mxmmrmpt.text="3", maxinc.state="0", mininc.state="1", svb_Svrsltst.active="1", svb_Svrsltst.objectname="sset.result", svb_Svrsltst.parent=".GlobalEnv", var_data.available="sleep", vrsl_Fltrbyvr.available="sleep[[\"extra\"]]", vrsl_Slctdvrb.available="sleep[[\"extra\"]]\nsleep[[\"ID\"]]", submit.mode="submit")
 		})
 	), postCalls = list (
 			function(){rm("women", pos=globalenv())}





More information about the rkward-tracker mailing list