DataRange::GetMaskedData

Contents

Description

Get all masked data into a vector.

Syntax

int GetMaskedData( DWORD dwRules, int nIndex, vector<int> * pvintRows, vector * pv, vector * pvIndep = NULL, matrix * pmMultiIndep = NULL, vector * pvWeights = NULL, vector * pvYIndep = NULL )

Parameters

dwRules
[input] the rules for data extraction, to be taken out of the DRR_ enumeration.
nIndex
[input] the index of the data. DataRange can reference multiple sets of data. Index starts from 0.
pvintRows
[output] it receives the number of the rows which have missing value
pv
[output] it receives the main data of the row which has masked data .
pvIndep
[output] it receives the X-independent data if DRR_GET_DEPENDENT or DRR_GET_Z_DEPENDENT rules bits are passed in.
pmMultiIndep
[output] it receives the (potentially) multiple X-independent data if DRR_GET_DEPENDENT and DRR_ONE_DEP_MULTIINDEP bits are passed in
(appropriate for Multiple Regression).
pvWeights
[output] it receives the weight values
pvYIndep
[output] it receives the y-independent values (used only if DRR_GET_Z_DEPENDENT bit passed in)

Return

Examples

EX1

// This example assumes 1 or more columns of data with some values masked.
//Get the data and only masked data from datarange.
void DataRange_GetMaskedData_Ex1(int nXColStart = 0, int nXColEnd = 1)
{
    Worksheet wks = Project.ActiveLayer();
    if( wks )
    {
        DataRange dr;
        dr.Add("X", wks, 0, nXColStart, -1, nXColEnd);
        vector vX, vMaskedValues;
        vector<int> vRowsWithMaskedValues;
        DWORD dwPlotID;
        //Get data(not masked in the datarange.
        int ii = dr.GetData(DRR_COMBINED_SIMPLE | DRR_GET_MISSING | DRR_NO_FACTORS, 0, &dwPlotID, NULL, &vX);
        //Get masked data in the datarange.
        int jj = dr.GetMaskedData(DRR_COMBINED_SIMPLE | DRR_NO_FACTORS, 0, &vRowsWithMaskedValues, &vMaskedValues);
    }
}

Remark

See Also

DataRange::GetNumData, DataRange::GetData, DataRange::SetData, Curve::Curve, curvebase::AttachX, DataRange::GetMissingData

header to Include

origin.h