What's the best way to install R packages on Linux?

放肆的年华 提交于 2020-01-16 13:13:49

问题


I happen to have Linux Mint on my machine (and I am not very experienced in Linux). When trying to install R packages (using install.packages()) on Linux Mint, I've got the following problems:

  1. The installation process goes very slowly (the packages are being compiled each time)
  2. Some packages could not be installed due to compilation errors.

So, I wonder, is there any standard approach to install packages for Linux Mint?


回答1:


The repositories are available in any standard Ubuntu installation via the package manager. To get the latest version try adding cran.rstudio.com repository for Ubuntu:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo add-apt-repository 'deb [arch=amd64,i386] https://cran.rstudio.com/bin/linux/ubuntu xenial/'
sudo apt-get update
sudo apt-get install r-base

(Details see R-Project homepage)



来源:https://stackoverflow.com/questions/49251944/whats-the-best-way-to-install-r-packages-on-linux

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