简体   繁体   中英

Install dplyr package in R for MS SQL server 2016

How to install a particular R package dplyr on SQL Server 2016. How we can install this package on SQL Server 2016.

I am trying to install dplyr on server side :

lib.SQL<-"C:\\Program Files\\Microsoft SQL Server\\MSSQL13.MSSQLSERVER2016\\R_SERVICES\\library"
install.packages("dplyr",lib=lib.SQL)

Its getting installed. But while loading

library("dplyr")

Its throwing error , library not found

在此处输入图片说明

I followed this link

after installing i was still getting error while loading dplyr package.

I was able to use dplyr after adding its dependencies :

  • DBI
  • assertthat
  • Rcpp
  • magrittr
  • tibble

After that, the command :

EXEC sp_execute_external_script @language =N'R', @script=N'library(dplyr)';

returned :

STDERR message(s) from external script: 

Attaching package: 'dplyr'

The following objects are masked from 'package:stats':

    filter, lag

The following objects are masked from 'package:base':

    intersect, setdiff, setequal, union

Installing packages into SQL Server is a security and reliability risk which is why a package can't install its dependencies itself. After all, a package installation will affect all users and packages that run on that server. A single incompatibility could break everyone's scripts.

That's why the DBA has to install all required dependencies separately.

Simply installing dplyr and trying to use it will return errors saying that the dependencies are missing. Unfortunately, the error message only mentions the first package that failed to load.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM