ExportMatrixToR

Prototype

void ExportMatrixToR( Matrix mData, String sRVarName )

Parameters

Matrix mData
The IML matrix containing the data to assign to the R variable.

String sRVarName
The name of the R variable to which the matrix will be assigned.

Remarks

This module assigns an IML matrix to an R variable. After calling this module, the R variable will be a matrix.

This module performs the same function as the method R.SetMatrix.

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

IMPORTANT: This module exports data to client-side R. You must use the RUN statement to invoke this module because there is a corresponding built-in IML subroutine of the same name that exports data to server-side R.
Example
nm = { 11 12,
       21 22,
       31 32 };

cm = { "X1" "Y1",
       "X2" "Y2",
       "X3" "Y3" };

run ExportMatrixToR( nm, "n1" );
run ExportMatrixToR( cm, "c1" );

submit / R;
n1
c1
endsubmit;
See Also

R.SetMatrix