R integration

R calculation step

The R calculation procedure step is a brand new functionality that transfers data to Rserve, where it’s processed through R language. It then retrieves output data and stores it into cubes in Board.
The new procedure step is located in the BEAM section of steps configuration.

The R-Calculation procedure performs the following actions:

  1. Connects to a Rserve instance
  2. Creates empty data frames defined in the "Stream data to R" and "Read R DataFrame" sections and populates the data frames defined in the "Stream data to R" section with Board data
  3. Executes the script (the script may populate the data frames defined in the "Read R DataFrame" section)
  4. Runs the Data Reader so that it reads data from R data frames defined in the "Read R DataFrame" section and stores it into Cubes in Board. When the process ends, the Procedure disconnects from Rserve


The R calculation step transfers data from Board to R in the form of data frames. Those data frames are processed through an R script and stored into new data frames that are sent back to Board via a Data Reader. 
 
To configure the step, proceed as follows:

  1. Configure the host Rserve.exe is running on (you will need the correct port number and login credentials)
  2. Configure data that will be sent from Board to R
    1. You can extract Cubes, Trees, Entities, or Layouts. Various objects can be extracted in a single step
    2. Each extractor must be associated with a data frame name
    3. Data will be read by R as data frames with their specific name
  3. Configure the R script in the dedicated text box using statements in R
  4. Configure the readback process. You will need to configure a list of Data Readers and data frames names they’re associated with

 When R starts running, Board will instantiate data frames with the selected names, overwriting any existing objects with the same name in R.

 

How to configure Rserve

To configure a working environment, you’ll have to install R on a server (or virtual machine) and install the Rserve package from the CRAN (Comprehensive R Archive Network).
 
To do that, enter the following command on the R console:
 install.packages(“RServe”,dest=”<DEST_DIR>”)
 
To run Rserve, enter the following command on the R console:

Rserve(args="--RS-conf C:\\Dataset\\Rserv.cfg")


The configuration file is optional but, if used, may contain the following settings and information that are useful to Board:

  1. Remote access: enabled
  2. Authentication: enabled
  3. A credential list with usernames and passwords
  4. Port number