2.2.3.1 CategoricalData


Name

CategoricalData

Remark

An Origin C CategoricalData data set is a dynamically allocated and sized array of integers that is tied to an internal Origin data set of type Text. A CategoricalData data set maps the text values in the data to categories referenced by an index (1 based offset). The text value to index map is stored in the CategoricalMap data member. Origin currently supports Ordinal maps in which items are sorted (ordered) alphanumerically. If a non-Text worksheet column in Origin is attached to it will be converted to type Text. When non-Text columns are converted to Text only displayed digits are converted thus precision may be lost if all digits are not displayed in the worksheet. When non-Text columns contain numeric data attaching a CategoricalData data set prompts with a novice dialog box asking the user whether or not to proceed. If the user selects "No" (do not proceed) the conversion to text does not occur and the resulting CategoricalData object is invalid. The CategoricalData class is derived from the Dataset, vector, and vectorbase classes from which it inherits methods and properties.

Hierarchy

Examples

EX1

void CategoricalData_ex1()
{
    Worksheet wks;
    wks.Create();
    if (wks)
    { 
        string strWksColname = wks.Columns(0).GetName();
        strWksColname = wks.GetPage().GetName() + "_" + strWksColname;
 
        StringArray vMyCatMap;
        CategoricalData cdMyCatData(strWksColname);
        CategoricalMap cmMyCatMap;
        cmMyCatMap = cdMyCatData.Map;
        vMyCatMap = (StringArray) cmMyCatMap; // Reminder Message should select Yes and OK 
        //If no Reminder Messages pops up. Please choose menu Help: Reactivate Reminder Messages
    }
}

Header to Include

origin.h

Reference

Members

Name Brief Example
Attach Attach a CategoricalData object to an internal Origin data set Examples
CategoricalData Default constructor to create a CategoricalData object. Examples
Group Sort an input vector into columns in a matrix by this CategoricalData set. Examples

Property

Name Brief Example
Map The text value to index map for this CategoricalData data set. See the CategoricalMap class for more details. Examples