R Tools for Visual Studio, the open-source Visual Studio add-in for R programmers, has a new update available for download. RTVS 0.5 makes it easier to run R within SQL Server 2016 as a stored procedure, and supports multiple windows for R graphics.
RTVS 0.5 makes use of Visual Studio's polyglot nature so you can manage and edit SQL queries within R projects. You can now add a SQL query to an R project, add a database connection, and easily check the output from the query. (You can even inspect the execution plan to optimize the query.) Once you've got a query that works, you can click to generate a connection string to use with the RODBC package. This short video explains the process.
RTVS also makes it easy to run R code as a SQL Server 2016 stored procedure. (This is a great way to make share the results of R code with other database users while making use of the power of the database for R computations.) The new SQL R Stored Procedure file works with SQL Server R Services to create a stored procedure that embeds R code you create, edit and test within RTVS. This greatly simplifies the process of running R code within SQL Server 2016 as you can see below:
The other major new feature from this release is the ability to create multiple plot windows, each of which can be docked within Visual Studio or float free as a separate window. Each window also maintains a history of previous plots, which can be retrieved either by using the back arrow or by browsing thumbnails in the plot history window. Here's how it works:
To use RTVS 0.5 you'll need to install/upgrade to Visual Studio 2015 Update 3 (either the free Community or Professional/Enterprise versions) first. And of course you'll also need an R installation: CRAN R, Microsoft R Open, and Microsoft R Client are all supported.