R Model Node
  • 04 Jan 2024
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

R Model Node

  • Dark
    Light
  • PDF

 

 This feature has been discontinued and no longer supported, effective immediately.

Article Summary

The R Model Node allows arbitrary R Language scripts to be executed as part of a graph. 

The R Node allows functions to be defined, which can be passed optional arguments. The function's return value is the value of the last expression in the function. 

All arguments are passed as strings, so type conversions are necessary before manipulation as numeric values.

For Example:

The example function below returns the sum of the two numeric input arguments. The last expression evaluated is the function return value. 

In a graph, it is necessary to map the input arguments and the return value from the function. Here, the schema is being used to map the values for the arguments above:

Resulting in the expected sum:

Vector Arguments and Return Values

A vector can be represented in JSON as a string field with separators. This example shows how a string field using a comma as a separator can be used as an input value and transformed into an R vector of numeric values.  

Gives the expected result:

Similarly, return vectors can be transformed into separated string fields using the paste() function:

Which gives the expected response:

Standard Authorized R Node Package and Functions

Xponent Authorizes a standard set of R node packages and functions to use. Please contact Xponent Support if you require more details.

Any additional functions or packages must be submitted to Xponent Support and reviewed by the Xponent security team before implementation.

We welcome suggestions for standard R libraries to be included in the standard package. 


Is it helpful? React and share your comment

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.
ESC

Eddy, a super-smart generative AI, opening up ways to have tailored queries and responses