Permissions-error using bash-script to install a library in R

淺唱寂寞╮ 提交于 2021-01-28 23:20:18

问题


I am running a software called CNV-Seq in a Bash script but, I do not have permission to run the following command:

R CMD INSTALL cnv/

The error is

* installing to library '/share/apps/r/3.2.2/intel/lib64/R/library'
Error: ERROR: no permission to install to directory '/share/apps/r/3.2.2/intel/lib64/R/library'

How can I solve this problem without gaining permission.


回答1:


One approach is creating the bash script that executes R script. So, the R script will contain:

install.packages("package_name")

Save it as xyz.r

and the bash script will contain:

R -f path_to/xyz.r

Save that as abc.

Run the bash script like this:

bash abc


来源:https://stackoverflow.com/questions/33697267/permissions-error-using-bash-script-to-install-a-library-in-r

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!