DataLab is a compact statistics package aiming at exploratory data analysis. Please visit the DataLab Web site for more information....


CopyDataColToVector

Declaration: TDataTable.CopyDataColToVector (Dest: TVector; Col, FirstRow, LastRow, DestElem: integer): integer;
The function CopyDataColToVector copies the numeric data of the column Col to the vector Dest. The parameter Col specifies the column to be copied, the parameters FirstRow and LastRow define the range of the cells in column Col, and the parameter DestElem specifies the target position of the first cell.

Nominal data values of the data table are replaced by their ordinals when copying them to Dest.

The function returns the following error codes:

 0 ... everything is OK, data has been copied
-1 ... invalid parameter Col (valid range is 1 ... NrOfColumns)
-2 ... FirstRow and/or LastRow are out of range (valid range: 1 ... NrOfRows)
-3 ... the parameter DestElem is out of range (valid range: 1 ... Dest.NrOfElem)
-4 ... the target vector Dest is not instantiated

Hint: Setting both FirstRow and LastRow to zero values is a shortcut for copying all cells of the specified column.