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

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.

主站蜘蛛池模板: 惠州市| 乌审旗| 常德市| 宁乡县| 来安县| 安吉县| 多伦县| 镇坪县| 汝城县| 始兴县| 锡林浩特市| 安远县| 乌拉特前旗| 门源| 佛坪县| 汶川县| 偏关县| 桂平市| 四平市| 习水县| 承德县| 泌阳县| 高台县| 恭城| 上栗县| 陇南市| 紫云| 望奎县| 云梦县| 长沙市| 清苑县| 温州市| 大丰市| 阜阳市| 义乌市| 金坛市| 忻州市| 前郭尔| 阳西县| 北海市| 大丰市|