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:
- Connects to a Rserve instance
- 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
- Executes the script (the script may populate the data frames defined in the "Read R DataFrame" section)
- 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:
- Configure the host Rserve.exe is running on (you will need the correct port number and login credentials)
- Configure data that will be sent from Board to R
- You can extract Cubes, Trees, Entities, or Layouts. Various objects can be extracted in a single step
- Each extractor must be associated with a data frame name
- Data will be read by R as data frames with their specific name
- Configure the R script in the dedicated text box using statements in R
- 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:
- Remote access: enabled
- Authentication: enabled
- A credential list with usernames and passwords
- Port number