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 have created your story, selected your data source, and added your R visualization to the story the R visualization structure pane will open on the right side of the screen. You must specify the table structure for your input data.
- 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.
You can also configure an input parameter for your visualization.
When you select Add Input Parameter, you will be able to select an input control. If the story already contains calculation input controls, you will be 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 example below, Existing Dimension was selected.
R code script
Using the example below, you can see the data, R code, and the final visualization created.
When your R code has been written, you can add the controls to the R visualization in SAP Analytics Cloud. The R code and controls enable the user to create the visualization, in this example, comparing one Texas city to all of the others.