RLoadLibrary()

Loads an R package.

Synopsis

int RLoadLibrary( const string filename, int userData);

Parameters

Parameter Description
fileName Package name.
userData User data of the function call. The user data variable can be set to an integer value and be used to detect errors when calling R functions. Set the variable to an integer value and when the function is called and an error occurs, the specified integer value is returned.

Return Value

The function returns 0 if it was successfully executed.

Description

Loads an R package.

Example

The example loads the Random Forest package:

#uses "CtrlR"
main()
{ 
  int userData = 1;
  int rc = RLoadLibrary("randomForest", userData);
  DebugN("Package loaded:", rc);
}

Assignment

R Functions

Availability

R Control Extension