# Custom R Components – Multiple Charts side-by-side

Often a single chart is only telling half the story.

Let SAP Predictive Analysis display any chart combination you need.

A standard box-plot for instance gives helpful information about the distribution of data. However, there is a lot of information it does not indicate, such as whether the data is uni-modal or multi-modal. Placing a histogram or bar chart next to the boxplot can help give a better understanding of the data.

With the ability to integrate Custom R Components into SAP Predictive Analysis you can now have multiple charts side-by-side.

Here is a little example that displays a quantitative variable in a boxplot next to a histrogram. The data is taken from this tutorial and shows the time in minutes it took male runners in their thirties to complete a certain marathon in the year 2012. The boxplot shows nicely that the median is around the 220 minute mark, so roughly at 3h 40.

However, having the histogram in the same view we see that the data has a bimodal distribution, which is important to interpret the data correctly. It turns out the modus is in the 220 to 240 minute range. Many runner’s clearly were aiming for a time under 4 hours. Another peak occurred with runners finishing between 180 and 200 minutes.

**How to Implement **

The component can be downloaded as .spar file from GitHub. Then deploy it as described here. You just need to import it through the option “Import/Model Component”, which you will find by clicking on the plus-sign at the bottom of the list of the available algorithms.

Hi Andreas,

thanks a lot for sharing this. During our HANA projects in Hospitals/ research institutes customers are keen to get information about R and HANA as a combination.

Therefore thanks a lot and best regards,

Bernhard

This is awesome, thanks.

One could also combine R charts with Lumira native charts.

For example, the boxplot could be done in Lumira and the histogram in R. ðŸ™‚

Cheers,

Henrique.