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

tfry at users.sourceforge.net tfry at users.sourceforge.net
Fri Feb 16 16:21:44 UTC 2007


Revision: 1406
          http://svn.sourceforge.net/rkward/?rev=1406&view=rev
Author:   tfry
Date:     2007-02-16 08:21:44 -0800 (Fri, 16 Feb 2007)

Log Message:
-----------
An option to call rk.edit to SPSS and CSV import plugins

Modified Paths:
--------------
    trunk/rkward/ChangeLog
    trunk/rkward/rkward/plugins/00saveload/import/import_csv.php
    trunk/rkward/rkward/plugins/00saveload/import/import_csv.rkh
    trunk/rkward/rkward/plugins/00saveload/import/import_csv.xml
    trunk/rkward/rkward/plugins/00saveload/import/import_spss.php
    trunk/rkward/rkward/plugins/00saveload/import/import_spss.rkh
    trunk/rkward/rkward/plugins/00saveload/import/import_spss.xml

Modified: trunk/rkward/ChangeLog
===================================================================
--- trunk/rkward/ChangeLog	2007-02-16 15:08:15 UTC (rev 1405)
+++ trunk/rkward/ChangeLog	2007-02-16 16:21:44 UTC (rev 1406)
@@ -1,7 +1,8 @@
+- import SPSS and import CSV plugins gain option to open object for editing, automatically (checked by default)
 - warn when opening very large objects (with more than 250000 fields; this limit is configurable)
 - add a "copy" tag to facilitate writing plugins with both dialog and wizard interfaces		TODO: document, convert all wizards to use this
 - fixed: graph previews would stop working when the interface is switched from dialog to wizard or vice versa
-- new options for plugin dialogs: Configure whether code display is by default, and at what size
+- new options for plugin dialogs: Configure whether code display is shown by default, and at what size
 
 --- Version 0.4.6 - Feb-15-2007
 - make sure any LC_ALL environment setting will not be applied by SCIM plugin (if installed on the system)

Modified: trunk/rkward/rkward/plugins/00saveload/import/import_csv.php
===================================================================
--- trunk/rkward/rkward/plugins/00saveload/import/import_csv.php	2007-02-16 15:08:15 UTC (rev 1405)
+++ trunk/rkward/rkward/plugins/00saveload/import/import_csv.php	2007-02-16 16:21:44 UTC (rev 1406)
@@ -16,18 +16,21 @@
 	if ($quote == "other") $quote = quoteString (getRK_val ("custom_quote"));
 
 getRK("name"); ?> <- read.table (file="<? getRK("file"); ?>", header=<? getRK("header"); ?>, sep=<? echo ($sep); ?>, quote=<? echo ($quote); ?>, dec=<? echo ($dec); ?>, <? # doing row names (what a pity...) 
-if (getRK_val("rowname")!="NULL") {
-	echo( "row.names = ");
-	if (getRK_val("rowname")=="rowcol") echo (getRK("nomrow") . ",");
-	else echo (getRK_val("rownames") . ",");
-}
-# doing col names (what a pity...)
-if (getRK_val("colname") == "custoCol") echo ( "col.names = " . getRK_val ("colnames") . ",");
-# doing col class (what a pity...)
-if (getRK_val("colclass") == "custoClass") echo( "colClasses = " . getRK_val ("custoClasses") . ",");
-#doing what is left?> na.strings = "<? getRK("na")  ?>", nrows = <? getRK("nrows") ; ?>, skip =  <? getRK("skip") ; ?>, check.names = <? getRK("checkname") ; ?>, fill = <? getRK("fill") ; ?>, strip.white = <? getRK("stripwhite") ; ?>, blank.lines.skip = <? getRK("blanklinesskip") ; ?>, comment.char=<? echo (quoteString (getRK_val("commentchar"))); ?><? getRK("allow_escapes"); ?><? getRK("flush"); ?><? getRK("strings_as_factors"); ?>)
+	if (getRK_val("rowname")!="NULL") {
+		echo( "row.names = ");
+		if (getRK_val("rowname")=="rowcol") echo (getRK("nomrow") . ",");
+		else echo (getRK_val("rownames") . ",");
+	}
+	# doing col names (what a pity...)
+	if (getRK_val("colname") == "custoCol") echo ( "col.names = " . getRK_val ("colnames") . ",");
+	# doing col class (what a pity...)
+	if (getRK_val("colclass") == "custoClass") echo( "colClasses = " . getRK_val ("custoClasses") . ",");
+	#doing what is left
+?> na.strings = "<? getRK("na")  ?>", nrows = <? getRK("nrows") ; ?>, skip =  <? getRK("skip") ; ?>, check.names = <? getRK("checkname") ; ?>, fill = <? getRK("fill") ; ?>, strip.white = <? getRK("stripwhite") ; ?>, blank.lines.skip = <? getRK("blanklinesskip") ; ?>, comment.char=<? echo (quoteString (getRK_val("commentchar"))); ?><? getRK("allow_escapes"); ?><? getRK("flush"); ?><? getRK("strings_as_factors"); ?>)
+<?	if (getRK_val ("doedit")) { ?>
 
-<?
+rk.edit (<? getRK ("name"); ?>)
+<?	}
 }
 
 function printout () {

Modified: trunk/rkward/rkward/plugins/00saveload/import/import_csv.rkh
===================================================================
--- trunk/rkward/rkward/plugins/00saveload/import/import_csv.rkh	2007-02-16 15:08:15 UTC (rev 1405)
+++ trunk/rkward/rkward/plugins/00saveload/import/import_csv.rkh	2007-02-16 16:21:44 UTC (rev 1406)
@@ -12,6 +12,7 @@
 		<caption id="tab_general"/>
 		<setting id="file">The filename of the file to import</setting>
 		<setting id="name">The name of an R object to store the imported data in. If you chose an existing symbol name, you will be prompted, whether to overwrite this object.</setting>
+		<setting id="doedit">Whether the object should be opened for editing after it was imported</setting>
 		<setting id="header">Whether the first row of the file contains should be interpreted as column names</setting>
 		<setting id="dec">Decimal character used in the imported file</setting>
 		<setting id="custom_dec">If you selected "other" above, specify the character, here.</setting>

Modified: trunk/rkward/rkward/plugins/00saveload/import/import_csv.xml
===================================================================
--- trunk/rkward/rkward/plugins/00saveload/import/import_csv.xml	2007-02-16 15:08:15 UTC (rev 1405)
+++ trunk/rkward/rkward/plugins/00saveload/import/import_csv.xml	2007-02-16 16:21:44 UTC (rev 1406)
@@ -39,7 +39,10 @@
 		<tabbook>
 			<tab id="tab_general" label="General" >
 				<browser size="small" id="file" label="File name" />
-				<saveobject id="name" initial="my.csv.data" label="Object to save to"/>
+				<row>
+					<saveobject id="name" initial="my.csv.data" label="Object to save to"/>
+					<checkbox id="doedit" value="1" value_unchecked="0" label="Edit Object" checked="true" />
+				</row>
 				<checkbox id="header" value="TRUE" value_unchecked="FALSE" checked="true" label="First row contains column names"/>
 				<row>
 					<column>

Modified: trunk/rkward/rkward/plugins/00saveload/import/import_spss.php
===================================================================
--- trunk/rkward/rkward/plugins/00saveload/import/import_spss.php	2007-02-16 15:08:15 UTC (rev 1405)
+++ trunk/rkward/rkward/plugins/00saveload/import/import_spss.php	2007-02-16 16:21:44 UTC (rev 1406)
@@ -54,8 +54,11 @@
 		}
 	}
 }
-<?	} ?>
-<?
+<?	}
+	if (getRK_val ("doedit") && $data_frame) { ?>
+
+rk.edit (<? echo ($object); ?>)
+<?	}
 }
 
 function printout () {

Modified: trunk/rkward/rkward/plugins/00saveload/import/import_spss.rkh
===================================================================
--- trunk/rkward/rkward/plugins/00saveload/import/import_spss.rkh	2007-02-16 15:08:15 UTC (rev 1405)
+++ trunk/rkward/rkward/plugins/00saveload/import/import_spss.rkh	2007-02-16 16:21:44 UTC (rev 1406)
@@ -12,6 +12,7 @@
 		<caption id="tab_general"/>
 		<setting id="file">The filename of the file to import</setting>
 		<setting id="saveto">The name of an R object to store the imported data in. If you chose an existing symbol name, you will be prompted, whether to overwrite this object.</setting>
+		<setting id="doedit">Whether the object should be opened for editing after it was imported. Currently, this is only possible, if the object is saved as a data.frame (see next option).</setting>
 		<setting id="data_frame">Whether to save the data as a data.frame. The alternative is saving as a list (useful, if the columns in your SPSS data have different lengths)</setting>
 
 		<setting id="convert_var_labels">RKWard can display SPSS like variable labels. Check this option, if you would like to convert the SPSS variable labels to RKWard format. If you leave the option unchecked, the SPSS variable labels will still be available as an attribute "variable.labels" (see <link href="rkward://rhelp/read.spss" />)</setting>

Modified: trunk/rkward/rkward/plugins/00saveload/import/import_spss.xml
===================================================================
--- trunk/rkward/rkward/plugins/00saveload/import/import_spss.xml	2007-02-16 15:08:15 UTC (rev 1405)
+++ trunk/rkward/rkward/plugins/00saveload/import/import_spss.xml	2007-02-16 16:21:44 UTC (rev 1406)
@@ -6,6 +6,8 @@
 		<external id="filename"/>
 		<connect governor="filename" client="file.selection"/>
 		
+		<connect governor="data_frame.state" client="doedit.enabled" />
+		
 		<connect governor="use_labels.state" client="labels_limit.enabled"/>
 		<connect governor="use_labels.state" client="trim_labels.enabled"/>
 		
@@ -20,7 +22,10 @@
 			<tab id="tab_general" label="General">
 				<browser size="small" id="file" label="File name" />
 				<stretch/>
-				<saveobject id="saveto" initial="my.spss.data" label="Object to save to"/>
+				<row>
+					<saveobject id="saveto" initial="my.spss.data" label="Object to save to"/>
+					<checkbox id="doedit" value="1" value_unchecked="0" label="Edit Object" checked="true" />
+				</row>
 				<stretch/>
 				<checkbox id="data_frame" checked="true" label="Import as a data.frame" value="1" value_unchecked="0"/>
 				<frame label="Labels">


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