Easiest way to install additional packages in SQL Server R Services

Beginners coming to SQL Server R Services would find it a bit difficult to understand the integration of R and SQL Server. Bob Ward has provided a great insight into the SQL Server R Services Architecture in the recently concluded #SSGAS2016 summit.

When I started exploring this feature, the first bottleneck I faced was the installation of additional packages like ggplot2 or caret to R Services.

The following is the illustration of what happens when we try to load a library that is not yet available in SQL Server R Services

 

SSMS_Error_R_Library

Steps thru R Studio

   
  1. Install R Studio on the same machine as that of SQL Server Database Engine
  2. When R Studio is opened for the first time, it prompts for selection of existing R installation to work with
  3. The simplest way is to select the R Services folder that is in SQL Server Program Files folder as below

RInstallSelect

4. Open R Studio and run install.packages(“ggplot2”)

Thats all it takes….

Please note that this assumes that internet connectivity is available on the SQL Server instance

For additional options, please check out the MSDN Post

https://msdn.microsoft.com/en-in/library/mt591989.aspx

MSDN now has enhanced documentation on Getting Started with SQL Server R Services with topics including the architecture of R Services and lots of samples.

Hope you find this blog post useful and start on the exciting Data Science journey of R integration with SQL Server

Cheers!!

Veera

 

   

One Comment on “Easiest way to install additional packages in SQL Server R Services”

Leave a Reply

Your email address will not be published.