Creating a Story Using R Visualizations

Objectives
After completing this lesson, you will be able to:

After completing this lesson, you will be able to:

  • Explain R visualization components
  • Create a story using R visualizations
  • Add input controls

Initial Steps

R Visualization Components

An R visualization is based on the following components:

  1. Table structure: Input data based on a model, specified dimensions, dimension attributes, and filters
  2. Input controls: Input parameters based on a calculation input control
  3. R code script: A script executed to generate the visualization

Table Structure

Once you've created your story, selected your data source, and added your R visualization to the story, the R visualization structure pane opens on the right side of the screen.

  1. Select + Add Input Data and use the Table Structure settings to specify the table structure for your input data.
  2. Select the Expand icon under Designer to view a preview of the input data table structure.
    • Rows: Choose +Add Dimensions to add dimensions from the list of available options into your input data.
    • Columns: Use this to manage the available measures. Choose All Members to display the currently available measures.
    • Filters: Use this to manage the filters for the input data.

Check your knowledge in the following activity by specifying the table structure for your input data.

Input Controls

You can also configure an input parameter for your visualization.

When you select Add Input Parameter, you're able to select an input control. If the story already contains calculation input controls, you're able to choose any of the listed parameters.

You can choose between:

  1. Existing Dimension  to allow users to pick from members of a dimension
  2. Static List  to add custom values as options for the input control

In the following example, Existing Dimension was selected.

R Code Script

Using the example below, you can see the data, R code, and the final visualization created.

The data and the R code

When your R code has been written, you can add the controls to the R visualization in SAP Analytics Cloud. The R code and the controls enable you to create the visualization, in this example, comparing one Texas city to all of the others.

Create an R Visualization in SAP Analytics Cloud

Task 1: Add an R Visualization

Business Example

You work for an up and coming microbrewery in Melbourne and you have been invited to present at a national conference on the brewing trends and potential growth areas for microbreweries in Australia. You want to create a story with advanced visualizations so you decide to use the R visualization functionality in SAP Analytics Cloud.

Task Flow

In this practice exercise, you will perform the following tasks:

  1. Add an R visualization to a story
  2. Add input data from a source file using the story Builder pane
  3. Create a dataset and configure it in the Data view
  4. Add dimensions using the Input Data panel
  5. Add and edit a script using the R script editor
  6. Add the R visualization to your story

Add an Input Control to a Story

Task 1: Add an Input Control to a Story

Business Example

You want to create a story with advanced visualizations where you can interact with the data.

Task Flow

In this practice exercise, you will perform the following tasks:

  1. Add an input control to your story
  2. Add filters to the dimension

Log in to track your progress & complete quizzes