简体   繁体   中英

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

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?

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 )

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