This blog basically addresses some of the basic challenges and issues which many of us are facing when we do R integration with SAP PA. Yes SAP Predictive Analytics does provides us this smart feature of R integration which is a very well-known statistical based language. But sometimes some challenges which I am discussing below might come while doing this integration.

Problem 1: You have installed SAP PA but when you go to install R, sometimes an error message may come which won’t allow you to install and configure R internally.

Solution:

You have to install R manually and configure it with SAP PA. Below are the steps you can follow:

Step1:

If you are on a 64-bit Windows 7, make sure that you have a 64bit JRE and if you are on a 32-bit Windows 7, ensure that you have 32-bit JRE.

To check the version of JRE, run “java –version” on the command prompt.

After installing R, you need to install the R packages used by SAP Predictive Analysis 2.2 .

Below are the list of packages that are required.

rJava

RODBC

RJDBC

DBI

monmlp

AMORE

XML

pmml

arules

caret

reshape

plyr

foreach

iterators

These packages either you can download the zip files from- https://cran.r-project.org/bin/windows/base/old/3.1.2/ and install it. Or the second way is install it directly from the internet via R GUI Console . In the below snapshot you can see the two highlighted box, one is for installing packages from local zip files and the other one saying Install packages is for downloading packages from internet.

Step4:

To test if the required packages are installed correctly, Go to

Start->Programs->R->R3.1.2

In the command prompt, type library (rJava) .Press enter. It is successfully installed if you don’t see any error

Eg : > library(rJava)

Try this for all the packages for confirmation

Step5:

Go to SAP PA Expert mode Install and Configure R option. As shown below there will be a predefined default path for R installation folder, change it to the path where you have installed R.Then go back to Installation tab and click again on the install R option. Restart the tool, it should work now.

Problem2: Every time when you install some new package in R for making a new custom R algorithm, you have to make that new package installation reflect in your SAP PA Expert mode too otherwise your algorithm won’t work in SAP PA environment. While doing so you need to do the same step as step5 above. But some of the folks may get the below attached error :

Solution:

Go to configuration tab and change that default path to C:\Users\[Username]\.sappaand thenclick Install. Restart the tool, give it a try.

Problem3: One more common error is REngine Initialization Failed. This mostly occcurs when you run a model which is based on R algorithm not with SAP PA Expert Mode out of the box algorithms.

Solution: In the Configuration tab change the default path to the path where you have installed your R gui and then go to installation tab and click on Install R option. Restart the tool after this and rerun the model.

Above are the few of the challenges I faced, if anyone has any feedback or anything to be added which can be useful to others, you are more than welcome to comment.