How to install Tidyverse on Ubuntu 16.04 and 17.04

后端 未结 3 1778
甜味超标
甜味超标 2020-12-16 17:52

I\'m running Ubuntu 16.04 [now 17.04: see note in bold below] and R 3.4.1. I installed the latter this morning, so I presume it\'s the latest version. I want to install Tidy

相关标签:
3条回答
  • 2020-12-16 18:23

    I run into the same problem, using elementary loki, based on ubuntu 16.04. Reading the output, I realized there was a very informative error message, that looked like this

        ------------------------- ANTICONF ERROR ---------------------------
    Configuration failed because openssl was not found. Try installing:
     * deb: libssl-dev (Debian, Ubuntu, etc)
     * rpm: openssl-devel (Fedora, CentOS, RHEL)
     * csw: libssl_dev (Solaris)
     * brew: openssl@1.1 (Mac OSX)
    If openssl is already installed, check that 'pkg-config' is in your
    PATH and PKG_CONFIG_PATH contains a openssl.pc file. If pkg-config
    is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
    R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
    

    So I followed each prompt, installing the required deb, which came up to

    sudo apt-get install libssl-dev libxml2-dev libcurl4-openssl-dev 
    

    and it worked, after I had already tried installing the cran packages listed above, without adding the new repositories.

    0 讨论(0)
  • 2020-12-16 18:28

    In some cases I find that I need to install the Ubuntu packages. To install the Tidyverse I added

    sudo apt-get install r-cran-curl r-cran-openssl r-cran-xml2
    

    After installing these packages, I could install the Tidyverse.

    0 讨论(0)
  • 2020-12-16 18:29

    I believe had a similar problem trying to install the tidyverse package. Being reasonably new to Linux and a complete rookie to R, I followed the Ubuntu installation intructions on the CRAN Project's homepage. When I installed R, I deliberately skipped installation of the r-base-dev package, as it said it was intended for "package maintainers". I didn't really read the latter part or understand the necessity for compiling packages myself.

    Anyway, installing r-base-dev package, and allowed me to install the Tidyverse package without problems. The complete steps to get it to work should be something like below. In terminal do the following steps (Step 1-3 may or may not be necessary, but I've added them just in case):

    1. Add deb https://<my.favorite.cran.mirror>/bin/linux/ubuntu artful/ in your /etc/apt/sources.list file, replacing by the actual URL of your favorite CRAN mirror. See https://cran.r-project.org/mirrors.html for the list of CRAN mirrors.
    2. Add the repository key to your system:

      sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
      

      An alternate method can be used by retrieving the key with

      gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9
      

      and then feed it to apt-key with

      gpg -a --export E084DAB9 | sudo apt-key add -
      
    3. To install the complete R system, use

      sudo apt-get update
      sudo apt-get install r-base
      
    4. Then comes the step I missed, that proved crucial to be able to compile the packages within the Tidyverse package, namely installing the r-base-dev package:

      sudo apt-get install r-base-dev
      
    5. Then in RStudio execute the package installation command:

      install.packages(tidyverse)
      

    Hopefully this will work for you as well. Read the installation guide on the CRAN Projects homepages for further about the installation procedure.

    0 讨论(0)
提交回复
热议问题