R Visualization Components
An R visualization is based on the following components:
- Table structure: Input data based on a model, specified dimensions, dimension attributes, and filters
- Input controls: Input parameters based on a calculation input control
- R code script: A script executed to generate the visualization
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.
- Select + Add Input Data and use the Table Structure settings to specify the table structure for your input data.
- 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.
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:
- Existing Dimension to allow users to pick from members of a dimension
- 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.