Configuring R

After you have installed R, configure the R environment to enable R algorithms in the application. If you have already installed R-2.15.x or R-3.0.x, R-3.1.0 or R-3.1.2 and the required packages, you can skip the R installation step and directly configure R.

To configure R, perform the following steps:

  1. Launch SAP Predictive Analytics.
  2. Open Expert Analytics.
  3. From the File menu, choose Install and Configure R.
  4. On the Configuration tab, select Enable Open-Source R Algorithms.
  5. Choose Browse to select the R installation folder.
    For example, C:\Users\Public\R-3.1.2.
  6. Choose Ok.
    The "User Account Control" dialog box appears with a warning message.
  7. Choose Yes in the confirmation prompt.
Recommendation
  • When installing R packages, check that the folder containing the installed R packages exists under the file path in Start of the navigation path File Next navigation step Install and Configure R Next navigation step Configuration End of the navigation path.

    You can specify the exact location where you want an R package installed using the following command in R studio: install.packages("PackName",lib="PATH")

    For example: install.packages("recomandable",lib="C:/Users/Public/R-3.1.2/library"). After the installation, check the subfolder in the R file path. You should see a folder called recomandable.

  • Alternatively, if you have R packages installed in multiple locations, make sure that the Microsoft Windows® environment variable, R_LIBS, is pointing to each location. Add the folder locations to the R_LIBS variable, separating each one by a semicolon so they can be found by Expert Analytics.

    For example: R_LIBS=%R_HOME%\library;%YOUR_HOME_DIRECTORY%\Documents\R\win-library\3.1

    If the R_LIBS variable is not already available, you need to create this.

    Note You can use the .libPaths() function to display all locations where R packages are installed.