官术网_书友最值得收藏!

Using XP_CMDSHELL

This method is by far the fastest and is very useful when sharing T-SQL code, but it compromises using the command shell and many users and DBAs are not keen on this. By enabling xp_cmdshell in configurations and using this stored procedure, you can install any missing package. Using code with the -e switch, you can easily install the library:

R cmd -e install.packages("Hmisc")  

The following code will install the missing package on the R Server:

-- enable xp_cmdshell
EXECUTE SP_CONFIGURE 'xp_cmdshell','1';
GO
    
RECONFIGURE;
GO 
EXEC xp_cmdshell '"C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\R_SERVICES\bin\R.EXE"cmd -e
install.packages(''Hmisc'')';   
GO  

Running Vanilla R and adding the install.packages() function can be done if the user has been granted the permission. The results are as follows:

Figure 23

Using CMD and the -e switch, the deployment and computation of R code can be executed and simplified, but since this is not an official way I would not suggest using this, since it exposes security issues.

主站蜘蛛池模板: 天镇县| 弥渡县| 澎湖县| 石屏县| 白玉县| 佛山市| 淮南市| 淮安市| 民乐县| 腾冲县| 古丈县| 宜昌市| 怀柔区| 新丰县| 辉县市| 凌源市| 新余市| 琼结县| 桂林市| 石楼县| 湄潭县| 通辽市| 连江县| 岗巴县| 航空| 丹阳市| 汕尾市| 西宁市| 宁阳县| 苍南县| 花垣县| 邳州市| 德化县| 慈溪市| 正蓝旗| 凤山市| 台湾省| 湾仔区| 楚雄市| 大冶市| 洪泽县|