Configuring R 2.15.1 to be used with SAP Predictive Analysis
SAP Predictive Analysis comes with the option of integrating with R Language for using the Algorithms available in PA.
R, being an Open source product, there are quick upgrades to the versions of R. But, the problem arises when we try to use a higher version of R (other than 2.15.1), which is not supported by SAP PA.
Here are few steps that you can follow to use R with SAP PA, I have gone through few references and come up with this method of installing R.
[Note : Click on the Images to get a clear view of what it is.]
Step 1: Install SAP PA [Predictive Analysis].
Follow the steps given in this link for installing SAP PA, trial version.
Step 2: Follow the link to download Windows Version of R 2.15.1 for your system.
Run the setup after you agree with the GNU Public license, which will have R installed in your system.
Step 3: Open the R GUI in your windows System.
Fig 1: Navigate your Programs to start R GUI.
You will be getting an User Interface console of R like this,
Fig 2: The R GUI Console
Once you are ready with R, we need to install certain packages in R that is required by SAP PA.
So follow the menu path to install the packages,
In R console, Click, Menu Bar,
Select Packages -> Install Packages ->
Fig 3: Menu Path to select the “Install Package” option.
Choose the CRAN Mirror closest to your location.
Fig 4: Select the CRAN Mirror
Then select the Package (rJava) from the list.
Fig 5: Select the Package (rJava).
Once you press OK, the package rJava will be installed in your system.
Step 4: Repeat Step 3 for the Package (AMORE).
These two Packages (rJava) and (AMORE) are required to use R algorithms in SAP PA.
Step 5: Set up the environment variable for R.
Simply type the following code in R Console.
(Note: The path varies as per your system, please take note of it, and change it while executing in the console).
Sys.setenv(R_LIBS = “C:/Program Files/R/R-2.15.1/library”);
Sys.setenv(R_HOME = “C:/Program Files/R/R-2.15.1/”);
Sys.setenv(Path = “existing path; C:/Program Files/R/R-2.15.1/library/rJava/jri; C:/Program Files/R/R-2.15.1/bin”);
Step 6: Open SAP PA and we need to configure PA to use R Language.
Follow the Menu path
All Programs -> SAP Business Intelligence -> SAP Predictive Analysis
In the Menu Bar, follow the path,
File -> Install and Configure R
Fig 6: Select “Install and Configure R” option in SAP Predictive Analysis
You get a Pop up, where you can find option to Install R, and to Configure R.
Since we have already manually Installed R, no need to do the first step.
Kindly navigate to the Configuration Tab, you will have to select the Check box, and Browse to the File path where R is Installed in your system.
Refer the Image for help.
Fig 7: Configure R to be used in SAP PA
Then select OK.
Now we have configured R in PA.
When you navigate to the Predict Tab in PA, you can find the R Algorithms enabled.
Fig 8: To verify if R has been Configured properly in SAP PA.
Set the parameters for the R Algorithms and play with your data.