Two use cases for Pentaho/R Integration plugin

NOTE: This plugin is an old and open source version and is not the same as R script executor, which is available from Pentaho.

R Script Plugin supports two use cases:

  1. Execute R code for every row in the table
  2. Execute R code for whole table and aggregate the result

Pentaho/R Integration Plugin can be downloaded here: Downloads

Two demostrate the usage we develop the following transformation:

Schematically these two use cases are shown on the figures below.

Case 1
Case 2

The inputs and outputs and R code for two use cases are demonstrated on the image below.

In the first case we calculate the sum for every row, for example, c=a+b=1+2=3.
In the second case we calculate the average of vector a=(1, 1.56, 3) and vector b=(2, 1.57, 4) and then calculate the sum: c=mean(a) + mean(b) = 1.85333 + 2.52333 = 4.37666