DataObject.AddObs

Prototypes

void AddObs( Matrix mType1 <, Matrix mType2> )

Parameters

Matrix mType1
A matrix containing observation data you want to add to the DataObject. Each row in mType1 corresponds to a new observation. The columns in mType1 correspond, in left-to-right order, to the variables in the DataObject of the same data type.

Matrix mType2
If the DataObject contains both numeric and character variables, mType2 specifies the observation data for the variables not covered by mType1. For example, if mType1 specifies the observations' numeric data, mType2 would specify the observations' character data.

Remarks

This method adds new observations to the DataObject.

If the mType2 parameter is not specified, all the variables in the DataObject must have the same data type as the mType1 parameter.

Example
declare DataObject dobj = DataObject.Create( "Test" );
var1 = { 100 };
var2 = { "A1" };
var3 = { 2000 };
var4 = { "B1" };
dobj.AddVar( "Var1", var1 );
dobj.AddVar( "Var2", var2 );
dobj.AddVar( "Var3", var3 );
dobj.AddVar( "Var4", var4 );
newobs_n = { 101 2001,
             102 2002, 
             103 2003, 
             104 2004 }; 
newobs_c = { "A2" "B2",
             "A3" "B3", 
             "A4" "B4", 
             "A5" "B5" }; 
dobj.AddObs( newobs_n, newobs_c );
DataTable.Create( dobj ).ActivateWindow();