At the PASS Summitin Seattle this week, Microsoft's Jason Wilcox and Gopi Kumar demonstrated a SQL Server 2016 application that embeds R to predict what time you need to leave to catch a flight, given traffic, check-in time, and the likelihood of a flight leaving early or being delayed.
The underlying preditive model was created with the RevoScaleR package in Microsoft R Services running in SQL Server 2016. And the prediction and the histogram you saw in the app was generated using R called in real time directly from SQL.
If you'd like to try R in SQL Server 2016 yourself, Henk Vandervalk provides a step-by-step guide to installing the components. And for more information about how the various components connect with each other, check out this article in Infoworld.