IMsMethod.UseR

Syntax

UseR: Boolean;

Description

The UseR property determines whether connection to R is used on method calculation.

Comments

To get information whether method can be calculated by R, use the IMsMethod.SupportsR property.

Available values:

Example

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:

IMsMethod