I'm having difficulty install the R package devtools, has anyone else had success installing this package?

root@job-GFQfX40JK9zpK08B09fVP2zZ:/opt/notebooks# R

 

R version 4.1.3 (2022-03-10) -- "One Push-Up"

Copyright (C) 2022 The R Foundation for Statistical Computing

Platform: x86_64-pc-linux-gnu (64-bit)

 

R is free software and comes with ABSOLUTELY NO WARRANTY.

You are welcome to redistribute it under certain conditions.

Type 'license()' or 'licence()' for distribution details.

 

R is a collaborative project with many contributors.

Type 'contributors()' for more information and

'citation()' on how to cite R or R packages in publications.

 

Type 'demo()' for some demos, 'help()' for on-line help, or

'help.start()' for an HTML browser interface to help.

Type 'q()' to quit R.

 

> install.packages('devtools')

 

Installing package into ?/usr/local/lib/R/site-library?

(as ?lib? is unspecified)

also installing the dependencies ?systemfonts?, ?textshaping?, ?ragg?, ?pkgdown?

 

trying URL 'https://cloud.r-project.org/src/contrib/systemfonts_1.0.4.tar.gz'

Content type 'application/x-gzip' length 81757 bytes (79 KB)

==================================================

downloaded 79 KB

 

trying URL 'https://cloud.r-project.org/src/contrib/textshaping_0.3.6.tar.gz'

Content type 'application/x-gzip' length 35722 bytes (34 KB)

==================================================

downloaded 34 KB

 

trying URL 'https://cloud.r-project.org/src/contrib/ragg_1.2.2.tar.gz'

Content type 'application/x-gzip' length 424677 bytes (414 KB)

==================================================

downloaded 414 KB

 

trying URL 'https://cloud.r-project.org/src/contrib/pkgdown_2.0.6.tar.gz'

Content type 'application/x-gzip' length 871371 bytes (850 KB)

==================================================

downloaded 850 KB

 

trying URL 'https://cloud.r-project.org/src/contrib/devtools_2.4.4.tar.gz'

Content type 'application/x-gzip' length 374492 bytes (365 KB)

==================================================

downloaded 365 KB

 

* installing *source* package ?systemfonts? ...

** package ?systemfonts? successfully unpacked and MD5 sums checked

** using staged installation

Package fontconfig was not found in the pkg-config search path.

Perhaps you should add the directory containing `fontconfig.pc'

to the PKG_CONFIG_PATH environment variable

No package 'fontconfig' found

Package freetype2 was not found in the pkg-config search path.

Perhaps you should add the directory containing `freetype2.pc'

to the PKG_CONFIG_PATH environment variable

No package 'freetype2' found

Using PKG_CFLAGS=

Using PKG_LIBS=-lfontconfig -lfreetype

--------------------------- [ANTICONF] --------------------------------

Configuration failed to find the fontconfig freetype2 library. Try installing:

 * deb: libfontconfig1-dev (Debian, Ubuntu, etc)

 * rpm: fontconfig-devel (Fedora, EPEL)

 * csw: fontconfig_dev (Solaris)

 * brew: freetype (OSX)

If fontconfig freetype2 is already installed, check that 'pkg-config' is in your

PATH and PKG_CONFIG_PATH contains a fontconfig freetype2.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=...'

-------------------------- [ERROR MESSAGE] ---------------------------

<stdin>:1:10: fatal error: fontconfig/fontconfig.h: No such file or directory

compilation terminated.

--------------------------------------------------------------------

ERROR: configuration failed for package ?systemfonts?

* removing ?/usr/local/lib/R/site-library/systemfonts?

ERROR: dependency ?systemfonts? is not available for package ?textshaping?

* removing ?/usr/local/lib/R/site-library/textshaping?

ERROR: dependencies ?systemfonts?, ?textshaping? are not available for package ?ragg?

* removing ?/usr/local/lib/R/site-library/ragg?

ERROR: dependency ?ragg? is not available for package ?pkgdown?

* removing ?/usr/local/lib/R/site-library/pkgdown?

ERROR: dependency ?pkgdown? is not available for package ?devtools?

* removing ?/usr/local/lib/R/site-library/devtools?

 

The downloaded source packages are in

    ?/tmp/RtmpomLVrl/downloaded_packages?

Warning messages:

1: In install.packages("devtools") :

 installation of package ?systemfonts? had non-zero exit status

2: In install.packages("devtools") :

 installation of package ?textshaping? had non-zero exit status

3: In install.packages("devtools") :

 installation of package ?ragg? had non-zero exit status

4: In install.packages("devtools") :

 installation of package ?pkgdown? had non-zero exit status

5: In install.packages("devtools") :

 installation of package ?devtools? had non-zero exit status

Comments

6 comments

  • Comment author
    Ondrej Klempir DNAnexus Team

    I had success installing devtools package once I installed all the missing system dependencies via JupyterLab Terminal:

     

    apt update

    apt upgrade

    apt install libcurl4-openssl-dev

    apt-get install libbz2-dev liblzma-dev

    apt-get install libfontconfig1-dev

    apt-get install libharfbuzz-dev libfribidi-dev

    apt-get install libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev

    1
  • Thanks Ondrej, I was able to install devtools after following what you did. Thanks!

     

    I still had to do some additional steps to facilitate installation of the PheWAS package, which I'll outline here in case anyone else faces the same difficulties. After installing devtools with your help, I initially tried devtools::install_github("PheWAS/PheWAS"), however I got a cli incompatibility error. I solved this by restarting the kernel and installing cli (install.packages("cli")). Then, the installation PheWAS failed again due to failure to install nloptr. I determined that nloptr requires CMake, so I installed that via terminal (apt install cmake). I was then able to successfully install both nloptr and PheWAS.

    0
  • Comment author
    Ondrej Klempir DNAnexus Team

    Hello @Kathleen Keough?, that is great!

     

    I am really interested in your PheWAS research project. Could you please tell me more about on which type of data you apply the PheWAS R package?

    0
  • So far I'm just looking at whether any ICD10 codes from the summary diagnoses are significantly associated with some exonic variants in a gene of interest. I am planning to try PHESANT in the future as well (a webinar on that one would be much appreciated :) ). I actually am looking for an ICD10 table so I can more easily link code to to diagnoses, e.g. "C437" = "neoplasms". Is there a table like that for the version of ICD10 in UK Biobank?

    0
  • I forgot to say - I'm using the exome data from the 450k release (the updated release is still refreshing in my project).

    0
  • Comment author
    Ondrej Klempir DNAnexus Team

    That is interesting! For ICD10 in UKB RAP, I normally use Cohort Browser to see the mapping between code and diagnosis group.

     

    Sometimes, I find a publicly available ICD10 code mapping useful, e.g.

    https://github.com/k4m1113/ICD-10-CSV

    https://raw.githubusercontent.com/k4m1113/ICD-10-CSV/master/categories.csv

     

    0

Please sign in to leave a comment.