Skip to content

Uploading New R Library Packages

Somehow I have become the R DBA at my job which I don’t mind, I plan on taking Microsoft’s Professional Program on Data Science to be familiar with it.  But recently I’ve had to upload files to our R servers which the first time wasn’t too bad.  Copy these files to six different servers but come the second time around it became apparent that the Predictive Analytics Manger was going to be asking me to do this more frequently than I wanted to to it manually.  So I wrote a quick PowerShell function to take care of this added to our module we use in house.  It unzips the file provided to the correct location.  It does assume you have administrative rights to your server i.e. you can use the admin shares (c$) for example on the server.  You will need to get the function Get-CMSHost from my Running SQL Scripts Against Multiple Servers Using PowerShell post to run the code below.

UPDATE: If you install 9.1 R services on your existing 2016 R server you will end up two paths to your libraries. To fix this we just need to add a TOP 1 to the cmdlet to select the path for the 9.1 libraries.

One thought on “Uploading New R Library Packages

  1. Pingback: Deploying Packages To SQL Server R Services – Curated SQL

Leave a Comment