SlideShare a Scribd company logo
R Visualizations in SAP Analytics Cloud
R Visualizations in SAP Analytics Cloud
➢ R is an open-source programming language that includes packages for advanced visualizations, Statistics, Machine Learning and
much more.
➢ SAP Analytics Cloud R Visualization feature allows users to integrate their own R environment into SAP Analytics Cloud.
➢ The benefit of this is that people all over the world continue to invest a lot of time and energy into creating new and interesting
types of statistical charts and graphs that you can use to analyze and present your data.
➢ Another benefit of integrating R visualizations with SAP Analytics Cloud is that it’s flexible. You can change the chart type,
characteristics, and depict your information in a variety of ways.
➢ With this new integration in SAP Analytics Cloud, you can now:
• Insert R-visualizations into your story
• Interact with R-visualizations using SAP Analytics Cloud-controls (such as filters)
• Share these SAP Analytics Cloud stories, which include R-visualizations, with other users.
➢ With the R visualization capability, users are able to perform statistical and analytical analyses and create truly captivating visuals
to reflect these analyses.
➢ Also, it is important to note that these visualizations remain interactive and consider the row-level security of users.
➢ To add R visualizations to a story, you need to have an R server running and connected to SAP Analytics Cloud.
➢ This connection is typically handled by an administrator and includes the server or host address, port number, certificate for
encryption, and user credentials.
Prerequisites
➢ Before we get started with our visualizations we can check a couple of things. First, make sure you are connected with an R
Server.
➢ To do so your user must have admin rights. Otherwise, please ask your system admin user for help. Different options are available
for example you may use your own R Server or use the SAP R Server. To do so go into the main menu and press “Administration”
under the point “System”:
➢ Then proceed to “R Configuration” at the top of the screen.
➢ Check if you are connected to the SAP R sever runtime environment or to your remote R connection. If this is the case, we can
proceed with our tutorial using the R Visualization in the SAC.
➢ Second, let’s have a look at our profile setting and make sure the number formatting is set to “1,234.56”. Otherwise, the dataset
won’t be recognized correctly in the SAC.
Using R with SAP Analytics Cloud
➢ You can use SAP Analytics Cloud to create and edit visualizations based on R scripts. R is an integrated suite of software that
includes packages for advanced visualizations and statistics to perform the following tasks:
• Insert R visualizations into your stories.
• Interact with your visualizations, using controls such as filters.
• Edit your R scripts and preview visualizations.
• Share stories containing R visualizations with other users. With the R visualization capability, users are able to perform statistical
and analytical analyses and create charts reflecting these analyses. These visualizations remain interactive and consider the row-
level security of users.
➢ The following resources are provided to help users:
• The requisite code snippet for listing all the available packages installed on your R system.
• Sample R scripts for visual statistical analysis.
• A dashboard containing an R script editor, a snapshot of the environment after the R script is run, a console containing the output
of the executed script, and a preview screen for the visualization.
7 June 2020Presentation titlePage 7
Section divider over two lines or three
lines
Section divider over two lines
or three lines
Adding R Visualizations to Stories
Adding R Visualizations to Stories
➢ You can insert an R visualization into a story by running R scripts on an externally deployed R environment, or an R server
runtime environment deployed by SAP Analytics Cloud if it available in your region.
Procedure:
1. From the Insert menu on the story canvas, select + (Add) > R Visualization.
• An empty R visualization is added to the canvas page.
2. To configure the input data for the R visualization:
a. Select +Add Input Data under INPUT DATA.
The Select Datasource dialog is displayed.
Note
If a data source has already been added to the story, it will be used by default.
b. Choose a model from the Select and Existing Model list and select OK.
c. Use the Table Structure settings to specify the table structure for your input data.
1.From the Insert menu on the story canvas, select
Note
Select the (Expand) icon under Designer to view a Preview for the input data table structure.
• ROWS: select +Add Dimensions to add dimensions from the list of available options into your input data. Hover over a dimension
to display the (More) icon if you want to specify display options or attributes. Use the Manage Filters icon to specify filters for
the dimension.
Note
To create a dynamic input control for a given dimension, select the Manage Filters icon and enable the Allow viewers to modify
selections option.
• COLUMNS: is used to manage the available measures. Select All Members to display the currently available measures. Hover over
a column entry to display the (More) icon if you want to specify display options or attributes. Use the Manage Filters icon to
specify filters for the measures.
• FILTERS: is used to manage the filters for the input data. Select +Add Filters to specify filters. Use Advanced Filtering to create
filters based on multiple dimensions by defining a set of logical conditions.
d. When you have finished setting up the table structure, select OK.
1.From the Insert menu on the story canvas, select
Note
Your input data can be directly referenced as a data frame in the R script editor. Remember the name used for the input data or,
alternatively, click the displayed entry to specify a new name.
3. To configure an input parameter for your visualization:
a. Under INPUT PARAMETERS, select an input control from the following options:
• If the story already contains calculation input controls, select +Add Input Parameter and choose any of the listed parameters.
• To create a new calculation input control, select +Add Input Parameter +Create a New Calculation Input Control.
The Calculation Input Control dialog is displayed.
b. Provide a name for the input parameter.
1.From the Insert menu on the story canvas, select
Note
Your input parameters can be directly referenced in the R script editor. Remember the name used for the parameter or, alternatively,
click the current name to specify a new name.
c. Select Existing Dimension to allow users to pick from members of a dimension, or Static List to add custom values as options for
the input control.
For Existing Dimension:
i. Select a model, select a dimension, and then select Click to Add Values.
ii. Select values from the list of available members.
If you select Exclude selected members, all members except the ones selected will be included in the input control. You can use
(Search) to find specific values. When you expand the list beside the search icon, you can choose to view the member Description, ID
and Description, or ID.
iii. Expand the Settings for Users section, and then choose whether users can do the following in the input control: Single
Selection, Multiple Selection, or Multiple Selection Hierarchy.
iv. Select OK.
1.From the Insert menu on the story canvas, select
For Static List:
d. Select Click to Add Values and choose either Select by Range or Select by Member.
i. If you have selected Select by Range, enter the Min and Max values for your range in the Set Values for Custom Range dialog.
You can optionally set an Increment value.
ii. Select OK.
iii. To create a member based input control, add numeric values to the Custom Members area in the Select Values from Custom
LOV dialog, and then select Update Selected Members.
iv. Expand the Settings for Users section, and then choose whether users can do the following in the input control: Single Selection,
or Multiple Selection.
v. Select OK.
4. Under Script, select + Add Script to create a new script, or Edit Script if a script has previously been specified.
The Script panel is displayed over the Designer.
5. Select the (Expand) icon under Designer to view the Editor, Environment, Console, and Preview panes.
1.From the Insert menu on the story canvas, select
6. Enter your script in the Editor and select Execute.
Note
• A list of suggested code is displayed if you press ctrl + space or if there are multiple suggestions based on the characters you have
typed in the Editor.
• Based on your coding context, the available R functions, data frames, R packages, vectors, arguments, input parameters, and
function lists appear on the left with a corresponding description (if available) on the right.
• To reference a data frame, enter the three letters of the data frame name. All data frame and input data names are preceded by
the icon. All input parameter names are preceded by the icon.
If the script is processed successfully, the following is displayed:
• The variables from the script output are listed in Environment.
• The outputted code from the executed script is displayed in Console.
• Any visualization rendered by the executed script is displayed in Preview.
1.From the Insert menu on the story canvas, select
Note
• Sample scripts to render R based visualizations are provided for your convenience. Go to <>(Snippets) > Examples to access the
samples.
• The code and visualizations rendered by these samples are for instructional purposes.
• If you have the requisite R programming background, you can use these samples to generate visualizations based on your data.
7. Select Apply to insert the R visualization into the current canvas page.
Note
You cannot export interactive HTML content to PDF. You cannot use remote or key figure models as input data. All hierarchies in
models are flattened when working with R.
1.From the Insert menu on the story canvas, select
Adding R Visualizations to Stories
➢ Once you have checked the connection, you can create a story from a data model already on SAP Analytics Cloud.
➢ By choosing insert and R visualization, this allows you to indicate that you want to include a visualization as result from a script
from R. It is important to indicate that you only can add visualization, but you can run any kind of R-script once you have validated
the required libraries.
1.From the Insert menu on the story canvas, select
➢ Which will generate the following frame on the Canvas:
➢ In the ‘Builder’-framework there are two important options:
• Input Data: to import the data into the R Visualization;
• Script: to use the R Script Editor, which applies the R Script on the imported data.
1.From the Insert menu on the story canvas, select
➢ After having imported the data, using the ‘Add Script’-functionality will give the following consoles to work with:
• Editor: R Script should be incorporated here.
• Console: displays what is being executed (either successfully, or else it will display error messages).
• Environment: additional information, such as the name of the imported dataset.
• Preview: preview of the results of the R Script that has been added in the Editor framework.
1.From the Insert menu on the story canvas, select
➢ When starting to add R Script in the Editor, there is an auto-complete wizard, just like in the R Studio for example:
➢ Please note that in general you will of course start with the library( …) statements, to initialize the R Script packages that are
installed by default. But, it is also possible to just use simple statements, such as ‘plot(…)’:
1.From the Insert menu on the story canvas, select
➢ Where executing will result in the following R Visualization:
1.From the Insert menu on the story canvas, select
7 June 2020Presentation titlePage 20
Section divider over two lines or three
lines
Section divider over two lines
or three lines
ggplot2 Visualizations Hands-On Examples
Composition - Pie Chart:
➢ Pie chart, a classic way of showing the compositions is equivalent to the waffle chart in terms of the information conveyed. But is
a slightly tricky to implement in ggplot2 using the coord_polar().
Correlation - Scatter Plot:
➢ The most frequently used plot for data analysis is undoubtedly the scatterplot. Whenever you want to understand the nature of
relationship between two variables, invariably the first choice is the scatterplot.
Diverging Bars:
➢ Diverging Bars is a bar chart that can handle both negative and positive values.
Correlation - Bubble plot:
➢ While scatterplot lets you compare the relationship between 2 continuous variables, bubble chart serves well if you want to
understand relationship within the underlying groups based on:
• A Categorical variable (by changing the color) and Another continuous variable (by changing the size of points).
Dynamic Grouping of values in Pie-chart:
➢ R Script to display top 9 and group rest as “others” in Pie Chart.
Dynamic Grouping of values in Pie-chart:
Ranking - Dot Plot:
➢ Dot plots are very similar to lollipops, but without the line and is flipped to horizontal position.
➢ It emphasizes more on the rank ordering of items with respect to actual values and how far apart are the entities with respect to
each other.
R Visualizations in SAP Analytics Cloud

More Related Content

PPTX
SAP CPI - DS
PDF
CNX16 - Connecting the Cloud: Marketing Cloud Connect
PPT
Data Warehousing and Data Mining
PPTX
How to choose between SharePoint lists, SQL Azure, Microsoft Dataverse with D...
PDF
Oracle Analytics Cloud
PDF
Building Dynamic Data Pipelines in Azure Data Factory (Microsoft Ignite 2019)
PDF
Unified MLOps: Feature Stores & Model Deployment
PPTX
Enterprise Security: Tableau vs. Power BI
SAP CPI - DS
CNX16 - Connecting the Cloud: Marketing Cloud Connect
Data Warehousing and Data Mining
How to choose between SharePoint lists, SQL Azure, Microsoft Dataverse with D...
Oracle Analytics Cloud
Building Dynamic Data Pipelines in Azure Data Factory (Microsoft Ignite 2019)
Unified MLOps: Feature Stores & Model Deployment
Enterprise Security: Tableau vs. Power BI

What's hot (20)

PDF
Batch Verification in SAP RF
PDF
Data Science
PPTX
Power BI Overview, Deployment and Governance
PDF
S4HANA Migration Overview
PPTX
Azure Synapse Analytics Overview (r2)
PDF
Data Quality
PDF
Data Architecture - The Foundation for Enterprise Architecture and Governance
PDF
Data quality metrics infographic
PDF
Introduction to data migration
PDF
Introduction to Azure Data Factory
PPTX
GDPR compliant data anonymization / pseudonymization
PPTX
Data integration
PPTX
Data Flow Diagrams
PDF
Sap S/4 HANA New Implementation
PPT
Characterization and Comparison
PPTX
Data warehousing - Dr. Radhika Kotecha
PPT
Chapter - 7 Data Mining Concepts and Techniques 2nd Ed slides Han &amp; Kamber
PPT
Data Warehouse Basic Guide
PPTX
Best Practices in DataOps: How to Create Agile, Automated Data Pipelines
Batch Verification in SAP RF
Data Science
Power BI Overview, Deployment and Governance
S4HANA Migration Overview
Azure Synapse Analytics Overview (r2)
Data Quality
Data Architecture - The Foundation for Enterprise Architecture and Governance
Data quality metrics infographic
Introduction to data migration
Introduction to Azure Data Factory
GDPR compliant data anonymization / pseudonymization
Data integration
Data Flow Diagrams
Sap S/4 HANA New Implementation
Characterization and Comparison
Data warehousing - Dr. Radhika Kotecha
Chapter - 7 Data Mining Concepts and Techniques 2nd Ed slides Han &amp; Kamber
Data Warehouse Basic Guide
Best Practices in DataOps: How to Create Agile, Automated Data Pipelines
Ad

Similar to R Visualizations in SAP Analytics Cloud (20)

PDF
Bridging data analysis and interactive visualization
PPTX
R-Studio Vs. Rcmdr
PPTX
Overview data analyis and visualisation tools 2020
PDF
Machine Learning in R
PPTX
Data analytics with R
PPTX
PDF
R-Language-Lab-Manual-lab-1.pdf
PDF
R-Language-Lab-Manual-lab-1.pdf
PDF
R-Language-Lab-Manual-lab-1.pdf
PPT
Scalable Data Analysis in R -- Lee Edlefsen
PPT
Basics of R
PDF
UNit4.pdf
PDF
Overview of tools for data analysis and visualisation (2021)
PDF
Introduction to r
PPTX
Unit I - 1R introduction to R program.pptx
PPTX
Interactive data visualization unit 5...
PPTX
Get more Visual Power
PPTX
Data Visualization1.pptx
PPT
PPT
Slides on introduction to R by ArinBasu MD
Bridging data analysis and interactive visualization
R-Studio Vs. Rcmdr
Overview data analyis and visualisation tools 2020
Machine Learning in R
Data analytics with R
R-Language-Lab-Manual-lab-1.pdf
R-Language-Lab-Manual-lab-1.pdf
R-Language-Lab-Manual-lab-1.pdf
Scalable Data Analysis in R -- Lee Edlefsen
Basics of R
UNit4.pdf
Overview of tools for data analysis and visualisation (2021)
Introduction to r
Unit I - 1R introduction to R program.pptx
Interactive data visualization unit 5...
Get more Visual Power
Data Visualization1.pptx
Slides on introduction to R by ArinBasu MD
Ad

Recently uploaded (20)

PPTX
Microsoft-Fabric-Unifying-Analytics-for-the-Modern-Enterprise Solution.pptx
PDF
.pdf is not working space design for the following data for the following dat...
PPTX
Supervised vs unsupervised machine learning algorithms
PDF
Foundation of Data Science unit number two notes
PPTX
STUDY DESIGN details- Lt Col Maksud (21).pptx
PPT
ISS -ESG Data flows What is ESG and HowHow
PDF
22.Patil - Early prediction of Alzheimer’s disease using convolutional neural...
PDF
Galatica Smart Energy Infrastructure Startup Pitch Deck
PPTX
MODULE 8 - DISASTER risk PREPAREDNESS.pptx
PDF
Recruitment and Placement PPT.pdfbjfibjdfbjfobj
PDF
Mega Projects Data Mega Projects Data
PPTX
IB Computer Science - Internal Assessment.pptx
PPTX
1_Introduction to advance data techniques.pptx
PPTX
climate analysis of Dhaka ,Banglades.pptx
PPTX
Introduction to Knowledge Engineering Part 1
PDF
BF and FI - Blockchain, fintech and Financial Innovation Lesson 2.pdf
PPTX
Business Acumen Training GuidePresentation.pptx
PPT
Quality review (1)_presentation of this 21
PDF
Lecture1 pattern recognition............
PPTX
iec ppt-1 pptx icmr ppt on rehabilitation.pptx
Microsoft-Fabric-Unifying-Analytics-for-the-Modern-Enterprise Solution.pptx
.pdf is not working space design for the following data for the following dat...
Supervised vs unsupervised machine learning algorithms
Foundation of Data Science unit number two notes
STUDY DESIGN details- Lt Col Maksud (21).pptx
ISS -ESG Data flows What is ESG and HowHow
22.Patil - Early prediction of Alzheimer’s disease using convolutional neural...
Galatica Smart Energy Infrastructure Startup Pitch Deck
MODULE 8 - DISASTER risk PREPAREDNESS.pptx
Recruitment and Placement PPT.pdfbjfibjdfbjfobj
Mega Projects Data Mega Projects Data
IB Computer Science - Internal Assessment.pptx
1_Introduction to advance data techniques.pptx
climate analysis of Dhaka ,Banglades.pptx
Introduction to Knowledge Engineering Part 1
BF and FI - Blockchain, fintech and Financial Innovation Lesson 2.pdf
Business Acumen Training GuidePresentation.pptx
Quality review (1)_presentation of this 21
Lecture1 pattern recognition............
iec ppt-1 pptx icmr ppt on rehabilitation.pptx

R Visualizations in SAP Analytics Cloud

  • 1. R Visualizations in SAP Analytics Cloud
  • 2. R Visualizations in SAP Analytics Cloud ➢ R is an open-source programming language that includes packages for advanced visualizations, Statistics, Machine Learning and much more. ➢ SAP Analytics Cloud R Visualization feature allows users to integrate their own R environment into SAP Analytics Cloud. ➢ The benefit of this is that people all over the world continue to invest a lot of time and energy into creating new and interesting types of statistical charts and graphs that you can use to analyze and present your data.
  • 3. ➢ Another benefit of integrating R visualizations with SAP Analytics Cloud is that it’s flexible. You can change the chart type, characteristics, and depict your information in a variety of ways. ➢ With this new integration in SAP Analytics Cloud, you can now: • Insert R-visualizations into your story • Interact with R-visualizations using SAP Analytics Cloud-controls (such as filters) • Share these SAP Analytics Cloud stories, which include R-visualizations, with other users. ➢ With the R visualization capability, users are able to perform statistical and analytical analyses and create truly captivating visuals to reflect these analyses. ➢ Also, it is important to note that these visualizations remain interactive and consider the row-level security of users. ➢ To add R visualizations to a story, you need to have an R server running and connected to SAP Analytics Cloud. ➢ This connection is typically handled by an administrator and includes the server or host address, port number, certificate for encryption, and user credentials.
  • 4. Prerequisites ➢ Before we get started with our visualizations we can check a couple of things. First, make sure you are connected with an R Server. ➢ To do so your user must have admin rights. Otherwise, please ask your system admin user for help. Different options are available for example you may use your own R Server or use the SAP R Server. To do so go into the main menu and press “Administration” under the point “System”: ➢ Then proceed to “R Configuration” at the top of the screen. ➢ Check if you are connected to the SAP R sever runtime environment or to your remote R connection. If this is the case, we can proceed with our tutorial using the R Visualization in the SAC.
  • 5. ➢ Second, let’s have a look at our profile setting and make sure the number formatting is set to “1,234.56”. Otherwise, the dataset won’t be recognized correctly in the SAC.
  • 6. Using R with SAP Analytics Cloud ➢ You can use SAP Analytics Cloud to create and edit visualizations based on R scripts. R is an integrated suite of software that includes packages for advanced visualizations and statistics to perform the following tasks: • Insert R visualizations into your stories. • Interact with your visualizations, using controls such as filters. • Edit your R scripts and preview visualizations. • Share stories containing R visualizations with other users. With the R visualization capability, users are able to perform statistical and analytical analyses and create charts reflecting these analyses. These visualizations remain interactive and consider the row- level security of users. ➢ The following resources are provided to help users: • The requisite code snippet for listing all the available packages installed on your R system. • Sample R scripts for visual statistical analysis. • A dashboard containing an R script editor, a snapshot of the environment after the R script is run, a console containing the output of the executed script, and a preview screen for the visualization.
  • 7. 7 June 2020Presentation titlePage 7 Section divider over two lines or three lines Section divider over two lines or three lines Adding R Visualizations to Stories
  • 8. Adding R Visualizations to Stories ➢ You can insert an R visualization into a story by running R scripts on an externally deployed R environment, or an R server runtime environment deployed by SAP Analytics Cloud if it available in your region. Procedure: 1. From the Insert menu on the story canvas, select + (Add) > R Visualization. • An empty R visualization is added to the canvas page. 2. To configure the input data for the R visualization: a. Select +Add Input Data under INPUT DATA. The Select Datasource dialog is displayed. Note If a data source has already been added to the story, it will be used by default. b. Choose a model from the Select and Existing Model list and select OK. c. Use the Table Structure settings to specify the table structure for your input data. 1.From the Insert menu on the story canvas, select
  • 9. Note Select the (Expand) icon under Designer to view a Preview for the input data table structure. • ROWS: select +Add Dimensions to add dimensions from the list of available options into your input data. Hover over a dimension to display the (More) icon if you want to specify display options or attributes. Use the Manage Filters icon to specify filters for the dimension. Note To create a dynamic input control for a given dimension, select the Manage Filters icon and enable the Allow viewers to modify selections option. • COLUMNS: is used to manage the available measures. Select All Members to display the currently available measures. Hover over a column entry to display the (More) icon if you want to specify display options or attributes. Use the Manage Filters icon to specify filters for the measures. • FILTERS: is used to manage the filters for the input data. Select +Add Filters to specify filters. Use Advanced Filtering to create filters based on multiple dimensions by defining a set of logical conditions. d. When you have finished setting up the table structure, select OK. 1.From the Insert menu on the story canvas, select
  • 10. Note Your input data can be directly referenced as a data frame in the R script editor. Remember the name used for the input data or, alternatively, click the displayed entry to specify a new name. 3. To configure an input parameter for your visualization: a. Under INPUT PARAMETERS, select an input control from the following options: • If the story already contains calculation input controls, select +Add Input Parameter and choose any of the listed parameters. • To create a new calculation input control, select +Add Input Parameter +Create a New Calculation Input Control. The Calculation Input Control dialog is displayed. b. Provide a name for the input parameter. 1.From the Insert menu on the story canvas, select
  • 11. Note Your input parameters can be directly referenced in the R script editor. Remember the name used for the parameter or, alternatively, click the current name to specify a new name. c. Select Existing Dimension to allow users to pick from members of a dimension, or Static List to add custom values as options for the input control. For Existing Dimension: i. Select a model, select a dimension, and then select Click to Add Values. ii. Select values from the list of available members. If you select Exclude selected members, all members except the ones selected will be included in the input control. You can use (Search) to find specific values. When you expand the list beside the search icon, you can choose to view the member Description, ID and Description, or ID. iii. Expand the Settings for Users section, and then choose whether users can do the following in the input control: Single Selection, Multiple Selection, or Multiple Selection Hierarchy. iv. Select OK. 1.From the Insert menu on the story canvas, select
  • 12. For Static List: d. Select Click to Add Values and choose either Select by Range or Select by Member. i. If you have selected Select by Range, enter the Min and Max values for your range in the Set Values for Custom Range dialog. You can optionally set an Increment value. ii. Select OK. iii. To create a member based input control, add numeric values to the Custom Members area in the Select Values from Custom LOV dialog, and then select Update Selected Members. iv. Expand the Settings for Users section, and then choose whether users can do the following in the input control: Single Selection, or Multiple Selection. v. Select OK. 4. Under Script, select + Add Script to create a new script, or Edit Script if a script has previously been specified. The Script panel is displayed over the Designer. 5. Select the (Expand) icon under Designer to view the Editor, Environment, Console, and Preview panes. 1.From the Insert menu on the story canvas, select
  • 13. 6. Enter your script in the Editor and select Execute. Note • A list of suggested code is displayed if you press ctrl + space or if there are multiple suggestions based on the characters you have typed in the Editor. • Based on your coding context, the available R functions, data frames, R packages, vectors, arguments, input parameters, and function lists appear on the left with a corresponding description (if available) on the right. • To reference a data frame, enter the three letters of the data frame name. All data frame and input data names are preceded by the icon. All input parameter names are preceded by the icon. If the script is processed successfully, the following is displayed: • The variables from the script output are listed in Environment. • The outputted code from the executed script is displayed in Console. • Any visualization rendered by the executed script is displayed in Preview. 1.From the Insert menu on the story canvas, select
  • 14. Note • Sample scripts to render R based visualizations are provided for your convenience. Go to <>(Snippets) > Examples to access the samples. • The code and visualizations rendered by these samples are for instructional purposes. • If you have the requisite R programming background, you can use these samples to generate visualizations based on your data. 7. Select Apply to insert the R visualization into the current canvas page. Note You cannot export interactive HTML content to PDF. You cannot use remote or key figure models as input data. All hierarchies in models are flattened when working with R. 1.From the Insert menu on the story canvas, select
  • 15. Adding R Visualizations to Stories ➢ Once you have checked the connection, you can create a story from a data model already on SAP Analytics Cloud. ➢ By choosing insert and R visualization, this allows you to indicate that you want to include a visualization as result from a script from R. It is important to indicate that you only can add visualization, but you can run any kind of R-script once you have validated the required libraries. 1.From the Insert menu on the story canvas, select
  • 16. ➢ Which will generate the following frame on the Canvas: ➢ In the ‘Builder’-framework there are two important options: • Input Data: to import the data into the R Visualization; • Script: to use the R Script Editor, which applies the R Script on the imported data. 1.From the Insert menu on the story canvas, select
  • 17. ➢ After having imported the data, using the ‘Add Script’-functionality will give the following consoles to work with: • Editor: R Script should be incorporated here. • Console: displays what is being executed (either successfully, or else it will display error messages). • Environment: additional information, such as the name of the imported dataset. • Preview: preview of the results of the R Script that has been added in the Editor framework. 1.From the Insert menu on the story canvas, select
  • 18. ➢ When starting to add R Script in the Editor, there is an auto-complete wizard, just like in the R Studio for example: ➢ Please note that in general you will of course start with the library( …) statements, to initialize the R Script packages that are installed by default. But, it is also possible to just use simple statements, such as ‘plot(…)’: 1.From the Insert menu on the story canvas, select
  • 19. ➢ Where executing will result in the following R Visualization: 1.From the Insert menu on the story canvas, select
  • 20. 7 June 2020Presentation titlePage 20 Section divider over two lines or three lines Section divider over two lines or three lines ggplot2 Visualizations Hands-On Examples
  • 21. Composition - Pie Chart: ➢ Pie chart, a classic way of showing the compositions is equivalent to the waffle chart in terms of the information conveyed. But is a slightly tricky to implement in ggplot2 using the coord_polar().
  • 22. Correlation - Scatter Plot: ➢ The most frequently used plot for data analysis is undoubtedly the scatterplot. Whenever you want to understand the nature of relationship between two variables, invariably the first choice is the scatterplot.
  • 23. Diverging Bars: ➢ Diverging Bars is a bar chart that can handle both negative and positive values.
  • 24. Correlation - Bubble plot: ➢ While scatterplot lets you compare the relationship between 2 continuous variables, bubble chart serves well if you want to understand relationship within the underlying groups based on: • A Categorical variable (by changing the color) and Another continuous variable (by changing the size of points).
  • 25. Dynamic Grouping of values in Pie-chart: ➢ R Script to display top 9 and group rest as “others” in Pie Chart.
  • 26. Dynamic Grouping of values in Pie-chart:
  • 27. Ranking - Dot Plot: ➢ Dot plots are very similar to lollipops, but without the line and is flipped to horizontal position. ➢ It emphasizes more on the rank ordering of items with respect to actual values and how far apart are the entities with respect to each other.