0

I am installing r packages using conda. It works fine when I use this example format

"conda install -c r r-scales --name condaenv"

But when I want to define installtion directory using --prefix

conda install -c r r-scales --prefix=/opt/local

the package "scale" is installed but I cannot find it in the directory I expect to be

"/opt/local/lib/R/library"

. It is weird because when I try to reinstall this package it says

All requested packages already installed.

that means this package is already installed in defined path. BUT WHERE? I also try using

conda list

But I cannot find "scales" among installed packages.
UPDATE: I also tried to use install.packages("scales), but I ran into this error

/opt/anaconda/bin/x86_64-conda_cos6-linux-gnu-ld: cannot find -lm collect2: error: ld returned 1 exit status make: *** [/raid60/raid2/opt/local/lib/R/share/make/shlib.mk:6: scales.so] Error 1 ERROR: compilation failed for package ?scales? * removing ?/raid60/raid2/opt/local/lib/R/library/scales?

  • Why not just installing R as is without conda? – David Arenburg Mar 27 '19 at 10:23
  • Because I have consistently got an error, not only for this package but for many others. I also asked admin to fix it but he did not manage to. That is the error /opt/anaconda/bin/x86_64-conda_cos6-linux-gnu-ld: cannot find -lm collect2: error: ld returned 1 exit status make: *** [/raid60/raid2/opt/local/lib/R/share/make/shlib.mk:6: scales.so] Error 1 ERROR: compilation failed for package ?scales? * removing ?/raid60/raid2/opt/local/lib/R/library/scales? – Seyed Omid Nabavi Mar 27 '19 at 10:30
  • That's an conda error. I'm asking why using conda in the first place. – David Arenburg Mar 27 '19 at 10:32
  • Sorry, is not it your question "why did not you use install.packages("scales)?" I did, but I got that error. – Seyed Omid Nabavi Mar 27 '19 at 10:35
  • Yes, this is what happens when you install conda- it takes over your environment variables and makes you completely depended on it. It is worse than a virus. If I were you, I would uninstall conda and just install R without it. – David Arenburg Mar 27 '19 at 11:33

1 Answers1

0

When using environments in conda, the r packages are installed inside the environment folder.

For instance, in Linux, if you have a environment condaenv, the R packages installed with conda (or its faster cousin mamba) should be located at:

~/conda/envs/condaenv/lib/R/library/

to locate the environment folder in your system you can look at the answers provided to this question.

RMS
  • 425
  • 4
  • 12