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.

Tracy Boggiano
Follow me

Tracy Boggiano

Database Administrator at ChannelAdvisor
Tracy has spent over 20 years in IT and has been using SQL Server since 1999 and is currently certified as a MCSE Data Platform. She has worked on SQL Server 6.5 and up including currently SQL 2017 CTP 2.0. She enjoys monitoring, performance tuning, and disaster recovery technologies.

She also tinkered with databases in middle school to keep her baseball card collection organized.

Her passion outside of SQL Server is volunteering with foster children as their advocate in court through http://www.casaforchildren.org.
Tracy Boggiano
Follow me