I am trying to install an R package to an R environment created through conda on an HPC Server where I am doing some bioinformatics. I tried to run the usual R command (which works and install the requested package in my local RStudio installation):

install.packages("http://hartleys.github.io/QoRTs/QoRTs_LATEST.tar.gz", repos=NULL, type="source");

However, when I try to run this same command in my conda R environment I keep getting the error:

-bash: syntax error near unexpected token `"http://hartleys.github.io/QoRTs/QoRTs_LATEST.tar.gzhttp://hartleys.github.io/QoRTs/QoRTs_LATEST.tar.gz"'

Any ideas as to why the normal syntax isn't being accepted in the conda R installation, what syntax do I use in this instance to overcome this issue and install packages through conda on a unix server?

  • 2
    Based on the error message, it sounds like you are typing the install.packages() command at a bash shell prompt, instead of inside an R session – steeldriver Dec 10 '19 at 14:25
  • But I created and activate a conda R environment so surely it should work? – Yaseen Ahammed Dec 11 '19 at 13:35
  • I used "#CONDA CREATE NEW R ENVIRONMENT conda create -n r_env r-essentials r-base conda activate r_env" to create and activate the environment. How would I create an R session inside a linux terminal? – Yaseen Ahammed Dec 11 '19 at 13:36
  • Sorry, I don't know enough about conda to offer a solution. I suspect that adding arbitrary packages within the environment may be non-trivial - see for example the discussion Using R and conda – steeldriver Dec 11 '19 at 13:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.