R.GetMatrix

Prototypes

static void GetMatrix( String sRExpr, Matrix mData )

Parameters

String sRExpr
An R expression that is evaluated and then coerced to a data frame.

Matrix mData
Upon return, contains an IML matrix in which the columns contain variables from the R data frame that resulted from evaluating sRExpr. If the first variable in the R data frame is a numeric variable, the mData matrix is a numeric matrix in which the columns contain the numeric variables of the R data frame. If the first variable in the R data frame is a character variable, the mData matrix is a character matrix in which the columns contain the character variables of the R data frame.

Remarks

This method evaluates an R expression and creates an IML matrix from the result. The method evaluates the R expression, coerces the result to an R data frame, and creates an IML matrix in which the columns contain variables from the data frame. If the first variable in the R data frame is a numeric variable, this method creates a numeric matrix in which the columns contain the numeric variables of the R data frame. If the first variable in the R data frame is a character variable, this method creates a character matrix in which the columns contain the character variables of the R data frame.

For information about how IML Studio transfers data from R to IMLPlus, please refer to the topic Data Exchange Details.

Example
submit / R;
m <- ToothGrowth
m
endsubmit;

R.GetMatrix( "m", x );
print x;
See Also

R.GetCharacterMatrix
R.GetNumericMatrix