问题
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