Information for: DEVELOPERS   PARTNERS

R Model node

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 return value of the function is the value of the last expression in the function.

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

In a graph, it is necessary to map the input arguments, and the return value from the function.

Vector arguments and return values

A vector can be represented in JSON as a string field with separators. 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.

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

Creating an R node

To create an R node, perform the following actions:

  1. Sign in to your Acquia Journey interface.
  2. Identify the project you wish to modify.
  3. Click the Project Editor icon.
  4. In the top left-hand corner of the screen, click the Action Menu icon.
  5. Select + Create New from the list.
  6. Enter the name of your new R node in the Name field.
  7. Scroll through the list of node types to find the Logic section, and click R Script
  8. Click Create New Item.