简体   繁体   中英

Rstudio in anaconda environment: how should I install R packages?

I create a new environment with anaconda and install Rstudio. My question is: how should I install R packages now? Should I use Rstudio --> install, or go through conda install... from the terminal? I just tried to install the desolve package through Rstudio and got the following error. Thank you so much. Riccardo

error:

ld: warning: directory not found for option '-L/opt/concourse/worker/volumes/live/59b7f007-fada-42cf-7435-5bbd0518eaa4/volume/r-base_1570124919999/_build_env/lib/gcc/x86_64-apple-darwin11.4.2/4.8.5'
ld: warning: directory not found for option '-L/opt/concourse/worker/volumes/live/59b7f007-fada-42cf-7435-5bbd0518eaa4/volume/r-base_1570124919999/_build_env/lib/gcc'
ld: warning: directory not found for option '-L/opt/concourse/worker/volumes/live/59b7f007-fada-42cf-7435-5bbd0518eaa4/volume/r-base_1570124919999/_build_env/lib'
ld: warning: directory not found for option '-L/opt/concourse/worker/volumes/live/59b7f007-fada-42cf-7435-5bbd0518eaa4/volume/r-base_1570124919999/_build_env/lib/gcc/x86_64-apple-darwin11.4.2/4.8.5'
ld: warning: directory not found for option '-L/opt/concourse/worker/volumes/live/59b7f007-fada-42cf-7435-5bbd0518eaa4/volume/r-base_1570124919999/_build_env/lib/gcc'
ld: warning: directory not found for option '-L/opt/concourse/worker/volumes/live/59b7f007-fada-42cf-7435-5bbd0518eaa4/volume/r-base_1570124919999/_build_env/lib'
ld: warning: -pie being ignored. It is only used when linking a main executable
ld: warning: object file (daux.o) was built for newer OSX version (10.15) than being linked (10.9)
ld: warning: object file (dintdy2.o) was built for newer OSX version (10.15) than being linked (10.9)
ld: warning: object file (ddaspk.o) was built for newer OSX version (10.15) than being linked (10.9)
ld: warning: object file (dlsoder.o) was built for newer OSX version (10.15) than being linked (10.9)
ld: warning: object file (dlinpk.o) was built for newer OSX version (10.15) than being linked (10.9)
ld: warning: object file (errmsg.o) was built for newer OSX version (10.15) than being linked (10.9)
ld: warning: object file (dvode.o) was built for newer OSX version (10.15) than being linked (10.9)
ld: warning: object file (dsparsk.o) was built for newer OSX version (10.15) than being linked (10.9)
ld: warning: object file (radau5.o) was built for newer OSX version (10.15) than being linked (10.9)
ld: warning: object file (opkda1.o) was built for newer OSX version (10.15) than being linked (10.9)
ld: warning: object file (opkdmain.o) was built for newer OSX version (10.15) than being linked (10.9)
ld: warning: object file (radau5a.o) was built for newer OSX version (10.15) than being linked (10.9)
ld: warning: object file (zvode.o) was built for newer OSX version (10.15) than being linked (10.9)
ld: unsupported tapi file type '!tapi-tbd' in YAML file '/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/lib/libm.tbd' for architecture x86_64
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [/opt/anaconda3/envs/covid19/lib/R/share/make/shlib.mk:6: deSolve.dylib] Error 1
ERROR: compilation failed for package ‘deSolve’
* removing ‘/opt/anaconda3/envs/covid19/lib/R/library/deSolve’
Warning in install.packages :
  installation of package ‘deSolve’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/fv/c75qz5qj7v5dfn49ynsjz5tw0000gp/T/RtmpIpVTT3/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done

Anaconda is a package manager/self-contained workspace and should be used to install packages if using R through a conda environment.

To install desolve, you'll want to run the below from your conda environment. You can search for the conda availability of an R package here: https://anaconda.org/conda-forge

conda install -c conda-forge r-desolve

In my experience, conda-forge often has more updated versions of R packages and one should look there first for the install.

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