UseR: Boolean;
The UseR property determines whether connection to R is used on method calculation.
To get information whether method can be calculated by R, use the IMsMethod.SupportsR property.
Available values:
True. Method is calculated by R. To do this, set up integration with R in the repository. For details about integration setup see the How to Set Up Integration with R? section.
False. The method is calculated by means of Foresight Analytics Platform.
Executing the example requires that the repository contains a modeling container with the MS identifier containing a model with the MODEL_R identifier. Integration with R must be set up in the repository. For details about integration setup see the How to Set Up Integration with R? section.
Add links to the Metabase and Ms system assemblies.
Sub UserProc;
Var
mb: IMetabase;
msKey: Integer;
modelObj: IMetabaseObject;
transf: IMsFormulaTransform;
formula: IMsFormula;
method: IMsMethod;
Begin
// Get repository
mb := MetabaseClass.Active;
// Get modelling container key
msKey := mb.GetObjectKeyById("MS");
// Get model
modelObj := mb.ItemByIdNamespace("MODEL_R", msKey).Edit;
// Get model calculation parameters
transf := (modelObj As IMsModel).Transform;
formula := transf.FormulaItem(0);
method := formula.Method;
// Check if model can be calculated by R package
If method.SupportsR
Then
method.UseR := True;
Debug.WriteLine("Model is calculated by means of connection to R");
Else
Debug.WriteLine("Model does not support calculation by R");
End If;
// Save changes
modelObj.Save;
End Sub UserProc;
After executing the example the model is calculated by R. If the model does not support calculation by R, the console window displays corresponding message.
See also: