|DataLab is a compact statistics package aiming at exploratory data analysis. Please visit the DataLab Web site for more information....|
|Home Programming DataLab Matrices Data Table TDataTable|
|See also: DStore
The class TDataTable implements the data structure used by DataLab. It combines a rectangular numeric matrix with additional information, such as row and column names, cell states, or attributes.
The data of the table can be accessed by using the array property Elem. Please note that the data is always stored in floating point format, values of categorical variables are represented by the (rounded) ordinal value (see Nominal and Ordinal Data for more).
The size of the matrix is controlled by the properties NrOfRows and NrOfColumns. Changing its size can also be accomplished by using the method Resize. Please note that any change in matrix size triggers the OnResize event. Row and column attributes: each row or column has a numeric attribute between 0 and 255. These attributes may be used to assign different classes to some of the rows (array property RowAttrib), or columns (array property ColAttrib). The row and column names may have a maximum length of MaxNameDTWidth characters and can be accessed by the array properties RowName and ColName.
In order to cope with different cell states each cell of the data matrix may assume a combination of up to 8 independent states (8 bits per cell). These cell states can be used to indicate certain aspects of the data (e.g. for marking part of the data). The cell states can be manipulated by the array property CellState. The methods IfColHasCellState and IfRowHasCellState allow to test the cell states of entire columns or rows. There are several statistical methods which evaluate the cell states and use only those cells which are neither marked as csNAN, nor as csUndefined: CountNumCells, MeanVarOfNumCells, MinMaxOfNumCells, PercentileOfNumCells, QuartilesOfNumCells and SumOfNumCells.
Finally, TDataTable also stores a comment of arbitrary length which is accessible via the property Comment.
The data of the data table may be imported and exported from and to a simply formatted ASCII file by using ImportASCFile and ExportAsASCFile. Note that there is also the general procedure ReadHeaderOfASC which is not a method of TDataTable. This procedure allows to read the header information of ASC formatted files without the need to create an instance of TDataTable. Another method of importing data into the data table is either to copy data from an external TDataTable instance by using the method CopyContentsFrom.