Overview

Overview of the R Script Module

The R script tool in APM provides a way for you to utilize the R programming language to create scripts that can receive data from inputs, make calculations, and then return one or more outputs. These R scripts can then be used within Policy Designer to expand the functionality of policies.

R scripts can be as simple or as complex as you need them to be, depending on the data that you want the script to calculate. For instance, a simple R script may calculate and return a value based only on two inputs. A more complex R script might utilize ten inputs, and have ten different output values. This documentation does not cover the process of developing R code.

R Scripts in Policies

R scripts can be used within Policy Designer to expand the functionality of policies. After you create and save an R script, you can use the R Script nodes in Policy Designer to pass values into the R script, and receive calculated values out of the R script.

The parameters that you define in the R script determine how the R Script node in Policy Designer will behave. Each parameter that you specify as an input appears as a field in the Properties window for the R Script node. You can then use standard policy options to provide values to the parameters in the R script. Each parameter that you specify as an output determines what values subsequent nodes in the policy model can use for additional calculations or actions.

Note: Before you can execute or validate a policy that includes an R node, you must complete the R server installation and configuration steps.

Access an R Script

Procedure

  1. In the Applications menu, navigate to the TOOLS section, and then select R Scripts.

    The R Scripts page appears.



    Note: Only R scripts created or accessed from the R Scripts page appear in this list. The 25 most recently accessed R scripts will appear in the list.
  2. Choose one of the following:
    • Select an R script from the grid.
    • Browse the Catalog to select an R Script. To do so:
      1. Select Browse.

        The Select a rscript from the catalog window appears.

      2. Select an R script.
      3. Select Open.
    A new page appears, displaying the selected R script.
    Tip: If you want to modify the script, make any required changes, including updating the values in the Parameters pane, and then select .

R Script Workflow

This workflow provides the basic, high-level steps for using this module. The steps and links in this workflow do not reference every possible procedure.

  1. Create a new R script.
  2. Enter R code in the R script editor.
  3. Define each parameter in the R script.
  4. Save the R script.
  5. Create a policy containing the R Script node in order to execute the R script.