sqlmlutils
sqlmlutils copied to clipboard
sql_install.packages creates external package library for R packages
Hi, I'm checking which packages are already installed (SQL Server 2019) and the related library path using a specific connection string
connection <- connectionInfo( server = "server\\instance", database = "anyDB")
for the SQL server/instance. The default library path is C:\Program Files\Microsoft SQL Server\MSSQL15.MHPROD01\R_SERVICES\library .
sql_installed.packages(connectionString = connection, fields=c("Package", "LibPath", "Attributes", "Scope"))
When running this function to install an arbitrary package (for example "tidyverse" or any other)
sql_install.packages(connectionString = connection, pkgs = "tidyverse", verbose = TRUE, scope = "PUBLIC")
then a new external library path F:\Program Files\Microsoft SQL Server\MSSQL15.MHPROD01\MSSQL\ExternalLibraries\5\1\1\tidyverse\R is created.
Now, when running again
sql_installed.packages(connectionString = connection, fields=c("Package", "LibPath", "Attributes", "Scope"))
I can't find the previously installed new package.
Why is that? And how can I appropriately install new packages using sqlmlutils.