Getting Started with R in SAP Analytics Cloud

After completing this lesson, you will be able to:

After completing this lesson, you will be able to:

  • Explain R visualizations and the integration with SAP Analytics Cloud
  • Access R in an SAP Analytics Cloud

R Visualization Overview

R Language

The R language is widely used among statisticians and data miners for developing statistical software and data analysis and can be integrated with SAP Analytics Cloud (SAC) to create R visualizations.

R visualization is the powerful feature of SAP Analytics Cloud where we can use R code to create more complex charts that aren't directly available in SAP Analytics Cloud.

R Visualizations

R Integration with SAP Analytics Cloud

R Code Integration

A benefit of integrating R visualizations with SAP Analytics Cloud is that it’s flexible. It's possible to change the chart type, characteristics, and depict your information in a variety of ways. With the R visualization capability, you can perform statistical and analytical analyses and create truly captivating visuals to reflect these analyses.

Once integrated, use SAP Analytics Cloud to:

  • perform statistical analysis using a variety of techniques such as linear and non-linear modeling, time series analysis, and clustering
  • expand the visualization capability of SAP Analytics Cloud to tell even richer stories.

Using R in SAP Analytics Cloud, you can do the following:

  • Insert R visualizations into your stories
  • Interact with your visualizations, using controls such as filters
  • Edit your R scripts and preview visualizations
You can not only add visualizations, but you can run any kind of R script when you have validated the required libraries. Therefore, you could run a cluster model in R and then add the output as a visualization into your SAP Analytics Cloud story.

Access R in SAP Analytics Cloud

Accessing R

To add R visualizations to a story, you must have an R server running and connected to SAP Analytics Cloud. Your system must be configured to connect to an R runtime environment.

Depending on your region, you will either have:

  1. An R server that you set up with an R engine running on a machine in the cloud and configured to SAP Analytics Cloud
  2. An R server runtime environment provided by SAP

This connection is typically handled by an administrator and includes the server or host address, port number, certificate for encryption, and user credentials.

If you don't have an R server connected to SAP Analytics Cloud, first visit: Using R with SAP Analytics Cloud: Best practices for connecting and running your R environment

Access R in an SAP Analytics Cloud Story

Add R Visualizations from the Story Menu

Inserting an R visualization in your story is easy! You can either use the Add or More menu options.

The following interaction will test your knowledge of inserting elements into stories.

R Packages

There are a number of packages that you can use, but the ggplot2 package is popular and worth exploring as a starting point.

Depending on the package you choose, you can create different types of plot, for example:

  • Static outputs when using ggplot2 or lattice
  • Interactive outputs when using plotly, highcharter, networkD3, or DT

For a list of packages available, see: Packages for SAP Analytics Cloud

  • In the R environment managed by SAP, the Shiny R package isn’t supported due to public network access security considerations.
  • Remember that SAP Analytics Cloud hosts an R runtime environment with R packages that can be called using R scripts. R packages are NOT provided under SAP’s license terms and conditions: each is governed by an open source license assigned by the package’s copyright owner.

Log in to track your progress & complete quizzes