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

tfry at users.sourceforge.net tfry at users.sourceforge.net
Thu Feb 1 16:05:46 UTC 2007


Revision: 1279
          http://svn.sourceforge.net/rkward/?rev=1279&view=rev
Author:   tfry
Date:     2007-02-01 08:05:46 -0800 (Thu, 01 Feb 2007)

Log Message:
-----------
Some further small fixes to and added documentation for CSV import plugin

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

Added Paths:
-----------
    trunk/rkward/rkward/plugins/00saveload/import/import_csv.rkh

Modified: trunk/rkward/rkward/plugins/00saveload/import/import_csv.php
===================================================================
--- trunk/rkward/rkward/plugins/00saveload/import/import_csv.php	2007-02-01 15:30:08 UTC (rev 1278)
+++ trunk/rkward/rkward/plugins/00saveload/import/import_csv.php	2007-02-01 16:05:46 UTC (rev 1279)
@@ -4,11 +4,10 @@
 	
 	function calculate () {
 getRK("name"); ?> <- read.table (file="<? getRK("file"); ?>", header=<? getRK("header"); ?>, sep=<? getRK("sep"); ?>, dec=<? getRK("dec") ?>, <? # doing row names (what a pity...) 
-if (getRK_val("isrow")=="true") {
+if (getRK_val("rowname")!="NULL") {
 	echo( "row.names = ");
-	if (getRK_val("rowname")=="NULL") echo (getRK_val("rowname") . ",");
-	else if (getRK_val("rowname")=="rowcol") echo (getRK("nomrow") . ",");
-	else if (getRK_val("rowname")=="custoRow") echo (getRK_val("rownames") . ",");
+	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") . ",");

Added: trunk/rkward/rkward/plugins/00saveload/import/import_csv.rkh
===================================================================
--- trunk/rkward/rkward/plugins/00saveload/import/import_csv.rkh	                        (rev 0)
+++ trunk/rkward/rkward/plugins/00saveload/import/import_csv.rkh	2007-02-01 16:05:46 UTC (rev 1279)
@@ -0,0 +1,46 @@
+<!DOCTYPE rkhelp>
+<document>
+	<summary>
+Import Comma Separated Value files (other delimiters besides comma are supported).
+	</summary>
+
+	<usage>
+Choose the CSV file to import. An R object containing the data will be created. See <link href="rkward://rhelp/read.table" />.
+	</usage>
+
+	<settings>
+		<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="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="sep">The separator character used in the imported file</setting>
+
+		<caption id="tab_rows"/>
+		<setting id="rowname">How to determine row names? Either the rows can be numbered 1...n. Or you can specify a single column containing the row names (typically the first). Or you can provide a character vector of names.</setting>
+		<setting id="nomrow">See above. The column containing the row names, given either as a number, or as a column name (in the latter case, make sure to quote the name)</setting>
+		<setting id="rownames">See above. A vector of column names  (e.g. c ("row1", "row2", ... "rown"))</setting>
+
+		<caption id="tab_columns"/>
+		<setting id="colname">Use default column names (possibly read from first row of file), or use specific names?</setting>
+		<setting id="colnames">See above. Specify a character vector of column names (e.g. c ("col1", "col2", ... "coln"))</setting>
+		<setting id="colclass">Should be class of each column be determined automatically, or specified?</setting>
+		<setting id="custoClasses">See above. Specify a character vector with the names of the classes to use for each column</setting>
+
+		<caption id="tab_further_options"/>
+		<setting id="skip">This many rows will be skipped at the start of the file. Use, for instance, if the file contains a text header.</setting>
+		<setting id="nrows">Maximum number of rows to read (-1 to read all lines)</setting>
+		<setting id="na">How are missing values (NAs) written in the file to be imported?</setting>
+		<setting id="commentchar">If you enter a single character, here, everything after that character in a line will be ignored. Leave blank to disable detection of comments</setting>
+		<setting id="fill">If checked, and the rows have differing length, they will be padded with empty values in the imported data.</setting>
+		<setting id="checkname">Should column names be checked for validity?</setting>
+		<setting id="stripwhite">Should leading and trailing white space be removed from character fields?</setting>
+		<setting id="blanklinesskip">Should blank lines be ignored?</setting>
+	</settings>
+	<related>
+		<ul>
+			<li><link href="rkward://component/import_spss"/></li>
+			<li><link href="rkward://rhelp/read.table"/></li>
+		</ul>
+	</related>
+</document>

Modified: trunk/rkward/rkward/plugins/00saveload/import/import_csv.xml
===================================================================
--- trunk/rkward/rkward/plugins/00saveload/import/import_csv.xml	2007-02-01 15:30:08 UTC (rev 1278)
+++ trunk/rkward/rkward/plugins/00saveload/import/import_csv.xml	2007-02-01 16:05:46 UTC (rev 1279)
@@ -26,7 +26,7 @@
 	</logic>
 	<dialog label="Import CSV data" >
 		<tabbook>
-			<tab label="Load" >
+			<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"/>
 				<checkbox id="header" value="TRUE" value_unchecked="FALSE" checked="true" label="First row contains column names"/>
@@ -43,7 +43,7 @@
 					</radio>
 				</row>
 			</tab>
-			<tab label="Rows" >
+			<tab id="tab_rows" label="Rows" >
 				<checkbox value_unchecked="false" checked="false" value="true" id="isrow" label="Customize row names" />
 				<radio id="rowname" label="Rows names" >
 					<option value="NULL" label="Number" />
@@ -53,7 +53,7 @@
 				<input size="small" id="nomrow" initial="1" label="Column number or variable name" />
 				<input id="rownames" label="Vector of row names (quoted)" />
 			</tab>
-			<tab label="Columns" >
+			<tab id="tab_columns"  label="Columns" >
 				<radio id="colname" label="Column names" >
 					<option value="" label="Default" />
 					<option value="custoCol" label="Use a character vector" />
@@ -65,7 +65,7 @@
 				</radio>
 				<input id="custoClasses" label="Vector of column classes (quoted)" />
 			</tab>
-			<tab label="Options" >
+			<tab id="tab_further_options" label="Further Options" >
 				<row>
 					<input size="small" initial="0" id="skip" label="Skip x lines at the start of the file" />
 					<input size="small" initial="-1" id="nrows" label="Max number of lines to read (-1 for no limit)" />

Modified: trunk/rkward/rkward/plugins/00saveload/import/import_spss.rkh
===================================================================
--- trunk/rkward/rkward/plugins/00saveload/import/import_spss.rkh	2007-02-01 15:30:08 UTC (rev 1278)
+++ trunk/rkward/rkward/plugins/00saveload/import/import_spss.rkh	2007-02-01 16:05:46 UTC (rev 1279)
@@ -26,6 +26,7 @@
 	</settings>
 	<related>
 		<ul>
+			<li><link href="rkward://component/import_csv"/></li>
 			<li><link href="rkward://rhelp/read.spss"/></li>
 			<li><link href="rkward://rhelp/iconv"/></li>
 		</ul>

Modified: trunk/rkward/rkward/plugins/under_development.pluginmap
===================================================================
--- trunk/rkward/rkward/plugins/under_development.pluginmap	2007-02-01 15:30:08 UTC (rev 1278)
+++ trunk/rkward/rkward/plugins/under_development.pluginmap	2007-02-01 16:05:46 UTC (rev 1279)
@@ -36,6 +36,11 @@
 	<hierarchy>
 		<menu id="file" label="File">
 			<menu id="import" label="Import" index="4">
+				<!-- Do we want this? -->
+				<menu id="import_format" label="Import format" index="0">
+					<entry component="import_spss"/>
+					<entry component="import_csv"/>
+				</menu>
 			</menu>
 			<menu id="export" label="Export" index="5">
 			</menu>


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