[rkward] rkward/plugins/00saveload/import: Move some more options around.

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Fri Oct 2 12:02:57 UTC 2015


Git commit cb3b854f16a92e344f2b39d2b123c6d152f88538 by Thomas Friedrichsmeier.
Committed on 02/10/2015 at 12:02.
Pushed by tfry into branch 'master'.

Move some more options around.

M  +7    -9    rkward/plugins/00saveload/import/import_csv.rkh
M  +35   -29   rkward/plugins/00saveload/import/import_csv.xml

http://commits.kde.org/rkward/cb3b854f16a92e344f2b39d2b123c6d152f88538

diff --git a/rkward/plugins/00saveload/import/import_csv.rkh b/rkward/plugins/00saveload/import/import_csv.rkh
index 27bba73..03d89ab 100644
--- a/rkward/plugins/00saveload/import/import_csv.rkh
+++ b/rkward/plugins/00saveload/import/import_csv.rkh
@@ -24,28 +24,26 @@ Choose the CSV file to import. An R object containing the data will be created.
 		<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 row names  (e.g. c ("row1", "row2", ...,  "rown"), but you can also specify the name of an R object containing the names to use)</setting>
-
-		<caption id="tab_columns"/>
 		<setting id="colname">Use automatic column names (possibly read from first row of file), or use manually specified names?</setting>
 		<setting id="colnames">See above. Specify a character vector of column names (e.g. c ("col1", "col2", ..., "coln"), but you can also specify the name of an R object containing the names to use)</setting>
-		<setting id="flush">Should additional columns (not specified above, and not within the first five rows of input) be skipped? See parameter flush in <link href="rkward://rhelp/read.table"/>.</setting>
+		<setting id="checkname">Should column names be checked for validity?</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>
+		<setting id="flush">Should additional columns (not specified above, and not within the first five rows of input) be skipped? See parameter flush in <link href="rkward://rhelp/read.table"/>.</setting>
+		<setting id="fill">If checked, and the rows have differing length, they will be padded with empty values in the imported data.</setting>
 
-		<caption id="tab_strings"/>
+		<caption id="tab_further_options"/>
+		<caption id="frame_strings"/>
 		<setting id="allow_escapes">Should a backslash ('\') followed by a character be treated as an escaped character? Otherwise the sequence is read literally.</setting>
+		<setting id="stripwhite">Should leading and trailing white space be removed from character fields?</setting>
 		<setting id="strings_as_factors">Should columns containing character data be converted to factors in R, or should they be read as character vectors?</setting>
+		<setting id="na">How are missing values (NAs) written in the file to be imported? (Blank fields are also interpreted as NAs in columns that are not strings.)</setting>
 		<setting id="quote">String delimiter character(s) used in the file</setting>
 		<setting id="custom_quote">If you selected "other" above, you can specify which quoting character to use, here. Simply enter all character to use (without spaces or comma, e.g. "'@ to use ", ', and @ as string delimiters).</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>
diff --git a/rkward/plugins/00saveload/import/import_csv.xml b/rkward/plugins/00saveload/import/import_csv.xml
index 51964d5..51f67f1 100644
--- a/rkward/plugins/00saveload/import/import_csv.xml
+++ b/rkward/plugins/00saveload/import/import_csv.xml
@@ -129,8 +129,8 @@
 								<option value="" label="Any whitespace" />
 								<option id="sepOther" value="other" label="Other (specify below)" />
 							</radio>
-              <stretch />
-              <input id="custom_sep" label="Specify field separator character" required="true"/>
+							<stretch />
+							<input id="custom_sep" label="Specify field separator character" required="true"/>
 						</column>
 					</row>
 				</frame>
@@ -161,7 +161,7 @@
 								<option value="custoCol" label="Use a character vector" />
 							</radio>
 							<input id="colnames" label="Vector of column names (quoted)" required="true"/>
-							<checkbox id="flush" label="Skip trailing fields" value=", flush=TRUE" value_unchecked="" />
+							<checkbox value_unchecked="FALSE" checked="true" value="TRUE" id="checkname" label="Check syntax of column names" />
 							<radio id="colclass" label="Classes of columns" >
 								<option value="" label="Automatic" />
 								<option value="custoClass" label="Use a character vector" />
@@ -171,37 +171,43 @@
 						</frame>
 					</column>
 				</row>
+				<checkbox id="flush" label="Skip trailing fields" value=", flush=TRUE" value_unchecked="" />
+				<checkbox id="fill" checked="false" value="TRUE" value_unchecked="FALSE" label="Pad rows if unequal length" />
+				<stretch/>
 			</tab>
 			
 			<tab id="tab_further_options" label="Further Options" >
-				<row>
-				<column>
+				<frame label="String handling" id="frame_strings">
 					<checkbox id="allow_escapes" label="Allow escaped characters" value=", allowEscapes=TRUE" value_unchecked="" />
-					<radio id="strings_as_factors" label="Convert character columns to factors" >
-						<option value=", stringsAsFactors=TRUE" label="Convert to factor" />
-						<option value="" label="Default" checked="true" />
-						<option value=", stringsAsFactors=FALSE" label="Do not convert" />
-					</radio>
-					<radio id="quote" label="String delimiter" >
-						<option value="'\"'" label="" only" />
-						<option value="'\''" label="' only" />
-						<option value="'"\''" label="" and '" checked="true"/>
-						<option value="''" label="None / disabled" />
-						<option value="other" label="Other (specify below)" />
-					</radio>
-					<input id="custom_quote" label="Specify quoting character(s)" required="true"/>
-				</column>
-				<column>
-						<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)" />
-						<input size="small" initial="NA" id="na" label="Character for missing values" />
-						<input size="small" initial="#" id="commentchar" label="Character for comments" />
-					<checkbox id="fill" checked="false" value="TRUE" value_unchecked="FALSE" label="Fill the rows if unequal length" />
-					<checkbox value_unchecked="FALSE" checked="true" value="TRUE" id="checkname" label="Check syntax of the variables names" />
-					<checkbox value_unchecked="FALSE" checked="false" value="TRUE" id="stripwhite" label="Strip white values" />
+					<checkbox value_unchecked="FALSE" checked="false" value="TRUE" id="stripwhite" label="Strip leading and trailing whitespace" />
+					<row>
+						<column>
+							<radio id="strings_as_factors" label="Convert character columns to factors" >
+								<option value=", stringsAsFactors=TRUE" label="Convert to factor" />
+								<option value="" label="Default" checked="true" />
+								<option value=", stringsAsFactors=FALSE" label="Do not convert" />
+							</radio>
+							<stretch/>
+							<input size="small" initial="NA" id="na" label="Missing value string" />
+						</column>
+						<column>
+							<radio id="quote" label="String delimiter" >
+								<option value="'\"'" label="" only" />
+								<option value="'\''" label="' only" />
+								<option value="'"\''" label="" and '" checked="true"/>
+								<option value="''" label="None / disabled" />
+								<option value="other" label="Other (specify below)" />
+							</radio>
+							<input id="custom_quote" label="Specify quoting character(s)" required="true"/>
+						</column>
+					</row>
+				</frame>
+				<frame label="Skip" id="frame_skip">
+					<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)" />
+					<input size="small" initial="#" id="commentchar" label="Character for comments" />
 					<checkbox value_unchecked="FALSE" checked="true" value="TRUE" id="blanklinesskip" label="Skip blank lines" />
-				</column>
-			</row>
+				</frame>
 			</tab>
 		</tabbook>
 	</dialog>



More information about the rkward-tracker mailing list