DH_load_txt: Load a TXT file

Description Usage Arguments Details Value Author(s)

Description

Load files made by TXT standard

Usage

1
DH_load_txt(previous.name = "")

Arguments

previous.name

Default name for the new dataframe, optional

Details

The Load option allows the user to load a file into the workspace. The following sub-options are present:

Note: in all the dialogue boxes the fields marked by * must be filled, while the fields without the * can be left blank. Cautions:

  1. for undetected reason it is not possible to load files having more than 700 columns. If such a file has to be loaded, the following two options can be used:

    1. transpose the original data file, load it and then transpose it again (see Workspace Management)

    2. split the original data files into blocks of acceptable size, load them and then merge them (see Workspace Management)

  2. if a column contains both numeric and alphanumeric values, this column will be considered as alphanumeric and therefore no numeric computations will be possible on it (not even if only numerical values are selected); this characteristic will be kept also in case of modifications removing the alphanumeric data.

This option is used to import data from a TXT file. After the selection of the file (see Load/CSV), the following dialogue box is shown.
DHloadtxtmenu.png
The default name proposed to the user is the name of the file (if blank characters are present, they are removed). The default settings for decimal separator is .. Skip Top Rows requires the input of an integer number n, and allows to skip the reading of the first n rows. Skip Left Columns, requires the input of an integer number m and allows to skip the reading of the first m columns. If the first row of the file contains the names of the columns, the Header box should be selected (option given by default). If not, the names of the columns will be V1, V2, V3, .... If the first column of the file contains the names of the rows, the Row Names box should be selected (note: in order to be selected as Row Names, the column must not contain duplicated values). If not, the names of the rows will be 1, 2, 3, ....Finally, if the fields are separated by a Tab (instead of a blank) the Tab Separator box must be checked.
After pressing the OK button a check is made to verify whether the same name is already present in the workspace. If so, then the warning message in the Figure below appears informing the user that if he proceeds the variable to be loaded will overwrite the previous one.
DHloadynmenu.png
An example of a TXT file that can be read by this option is reported.

G R T
a1 18 512
a2 23 514
a3 36 81.45
a4 41.85 89
a5 52.043 67

After the file has been successfully loaded, the following message will be displayed: [1] xx Data loaded: r Rows & c Columns
Note: if the Header and Row Names options have been activated, the corresponding row and column will be treated separately and will not be taken into account as row and column of the data matrix. As an example, after having loaded the previous data file (5 rows and 2 columns), the displayed message will be:
[1] 10 Data loaded: 5 Rows & 2 Columns

Value

A new data.frame is added into the memory

Author(s)

Riccardo Leardi and Gianmarco Polotti with contributions from Giorgio Marubini.Gruppo di Chemiometria (Divisione di Chimica Analitica della Societa' Chimica Italiana)


polgia0/Chemometricmenus documentation built on May 28, 2019, 12:03 p.m.