none
Unable to change .libpath() in Microsoft R Server RRS feed

  • Question

  • I'm using R Tools for Visual Studio (1.0.30228.1316 RC2) and Microsoft R Server (3.3.2.0).  I want to change the default .libpath() to a folder I use to install all my R packages.  The default is:

    > .libPaths()
    [1] "C:/Program Files/Microsoft SQL Server/140/R_SERVER/library"

    I am unable to change the .libPath() using the standard method used in R Studio (i.e., .libPaths(c(.libPaths(), "C:/Rpackages"))

    The syntax does not return an error it simply does not change the .libpath():

    > .libPaths(c(.libPaths("C:/Program Files/Microsoft SQL Server/140/R_SERVER/library"), "C:/Users/pc/OneDrive/SQLScripts/R/Rpackages"))
    > .libPaths()
    [1] "C:/Program Files/Microsoft SQL Server/140/R_SERVER/library"

    Under "Workspaces" there is an option for  "R command line arguments" ... is this the place where you can set the default for the libpath?  Or how do you do it using VSTS and Microsoft R.  There is not much help from Google on this.


    SOTATS, Inc.

    Saturday, March 4, 2017 10:31 PM

All replies

  • Whenever you try to change .libPaths it will check that the requested paths exist. If they don't then no change will be made so you might check that the requested additional path exists via:

    > dir.exists("C:/Users/pc/OneDrive/SQLScripts/R/Rpackages")

    Tuesday, March 7, 2017 3:45 PM