[rkward-cvs] SF.net SVN: rkward:[4090] trunk/rkward/rkward/plugins/00saveload/import

sjar at users.sourceforge.net sjar at users.sourceforge.net
Fri Dec 9 20:40:16 UTC 2011


Revision: 4090
          http://rkward.svn.sourceforge.net/rkward/?rev=4090&view=rev
Author:   sjar
Date:     2011-12-09 20:40:15 +0000 (Fri, 09 Dec 2011)
Log Message:
-----------
* use sheet name or sheet number instead of sheet number only

Modified Paths:
--------------
    trunk/rkward/rkward/plugins/00saveload/import/import_xls.js
    trunk/rkward/rkward/plugins/00saveload/import/import_xls.xml

Modified: trunk/rkward/rkward/plugins/00saveload/import/import_xls.js
===================================================================
--- trunk/rkward/rkward/plugins/00saveload/import/import_xls.js	2011-12-09 20:38:57 UTC (rev 4089)
+++ trunk/rkward/rkward/plugins/00saveload/import/import_xls.js	2011-12-09 20:40:15 UTC (rev 4090)
@@ -5,18 +5,19 @@
 function calculate () {
 	var options = "";
 	
-	var sheet = getValue ("sheet");
 	var header = getValue ("header");
 	var verbose = getValue ("verbose");
 	
+	var sheet = getValue ("sheetname");
+	
 	var quote_char = getValue ("quote");
 	if (quote_char == "other") quote_char = quote (getValue ("custom_quote"));
 		
-	options = ", sheet=" + sheet + ", header=" + header + ", verbose=" + verbose;
+	options = ", header=" + header + ", verbose=" + verbose;
 
 	var object = getValue ("saveto");
 
-	echo ('data <- read.xls ("' + getValue ("file") + '"' + options + ', ');
+	echo ('data <- read.xls ("' + getValue ("file") + '", sheet="' + sheet + '"' + options + ', ');
 	echo (' nrows=' + getValue ("nrows") + ', skip=' + getValue ("skip") + ', na.string="'+ getValue ("na") +'"' + getValue("strings_as_factors") + 
 	      ', check.names = ' + getValue("checkname") + ', strip.white = ' + getValue("stripwhite") + ')\n');
 	echo ('.GlobalEnv$' + object + ' <- data		# assign to globalenv()\n');
@@ -27,7 +28,7 @@
 
 function printout () {
 	makeHeaderCode ("Import Microsoft EXCEL sheet", new Array("File", getValue ("file"), "Imported to", getValue ("saveto"), 
-								  "Imported Sheet", getValue ("sheet"), "First row as header", getValue ("header"), 
+								  "Imported Sheet", getValue ("sheetname"), "First row as header", getValue ("header"), 
 								  "Max number of rows to skip (-1 for no limit)", getValue ("skip"),
 								  "Number of lines to read (-1 for no limit)", getValue ("nrows"),
 								  "Character for missing values", getValue ("na")));

Modified: trunk/rkward/rkward/plugins/00saveload/import/import_xls.xml
===================================================================
--- trunk/rkward/rkward/plugins/00saveload/import/import_xls.xml	2011-12-09 20:38:57 UTC (rev 4089)
+++ trunk/rkward/rkward/plugins/00saveload/import/import_xls.xml	2011-12-09 20:40:15 UTC (rev 4090)
@@ -11,7 +11,7 @@
 		<tabbook>
 			<tab id="tab_general" label="General">
 				<browser type="file" allow_urls="true" id="file" label="File name" />
-	  		      	<spinbox type="integer" id="sheet" label="Sheet within the Excel file from which data are to be read" min="1" initial="1"/>
+				<input label="Name of sheet" id="sheetname" initial="1" size="medium" />
 				<stretch/>
 				<row>
 					<saveobject id="saveto" initial="my.xls.data" label="Object to save to"/>
@@ -22,8 +22,10 @@
 			<tab id="tab_further_options" label="Further Options" >
 				<column>
 				  	<checkbox id="header" value="TRUE" value_unchecked="FALSE" checked="false" label="Column names in first row"/>
-					<input size="small" initial="-1" id="nrows" label="Max number of rows to read (-1 for no limit)" />
-					<input size="small" initial="-1" id="skip" label="Number of rows to skip" />
+					<row>
+					      <input size="small" initial="-1" id="nrows" label="Max number of rows to read (-1 for no limit)" />
+					      <input size="small" initial="-1" id="skip" label="Number of rows to skip" />
+					</row>
 					<input size="small" initial="NA" id="na" label="Character for missing values" />
 					<radio id="strings_as_factors" label="Convert character columns to factors" >
 					  <option value=", stringsAsFactors=TRUE" label="Convert to factor" />

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