- SQL Server 2017 Machine Learning Services with R
- Toma? Ka?trun Julie Koesmarno
- 245字
- 2021-06-24 19:03:47
Using R Tools for Visual Studio (RTVS) 2015 or higher
With SQL Server 2016, Microsoft recommended installing missing packages through RTVS. The user should have installed RTVS (https://www.visualstudio.com/vs/rtvs/) on a client in order to install packages. Check the default paths:
sessionInfo() .libPaths()
This also returns the paths to the library folders on my machine-for R Server (by default C:/Program Files/Microsoft SQL Server/MSSQL14.MSSQLSERVER/R_SERVICES/library) and for the user (C:/Users/Tomaz/Documents/R/win-library/3.2) who is currently using RTVS:

Checking the Options... section:

Then select R Tools | Advanced (as shown next):

You will see that the R Engine has a path defined. This path is the root path for installing R packages. R packages are installed under the subfolder-library (C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\R_SERVICES\Library).
So, by running install.packages("AUC"), I can see that the server path was ignored and the library was installed into the user specified folder:

To install the package in the R Server folder, you need to have administrator-level access or have an administrator do it for you. Microsoft has discussed this issue on MSDN (https://docs.microsoft.com/en-us/sql/advanced-analytics/r/installing-and-managing-r-packages). Running Visual Studio and RTVS as an administrator does not change the result. To avoid this problem, you need to declare the path to the library folder of the R Server where you want package to be installed:
install.packages("AUC", dependencies = TRUE, lib = "C:/Program Files/Microsoft SQL Server/MSSQL14.MSSQLSERVER/R_SERVICES/library")
The package will automatically be installed in the R Server repository folder:

- Deep Learning Quick Reference
- 手把手教你玩轉(zhuǎn)RPA:基于UiPath和Blue Prism
- 計(jì)算機(jī)應(yīng)用復(fù)習(xí)與練習(xí)
- Mobile DevOps
- 城市道路交通主動(dòng)控制技術(shù)
- 工業(yè)機(jī)器人操作與編程
- Practical Big Data Analytics
- 云計(jì)算和大數(shù)據(jù)的應(yīng)用
- Flink原理與實(shí)踐
- 步步驚“芯”
- 大數(shù)據(jù)素質(zhì)讀本
- 玩機(jī)器人 學(xué)單片機(jī)
- 渲染王3ds Max三維特效動(dòng)畫技術(shù)
- 傳感技術(shù)基礎(chǔ)與技能實(shí)訓(xùn)
- Oracle Blockchain Quick Start Guide