Sophia Wilson
Sophia Wilson

Reputation: 477

Getting error while installing flextable library

I 'm getting following error while installing the flextable library at r studio.

ERROR: configuration failed for package ‘systemfonts’
* removing ‘/home/user/R/x86_64-pc-linux-gnu-library/3.2/systemfonts’
Warning in install.packages :
  installation of package ‘systemfonts’ had non-zero exit status
ERROR: dependency ‘systemfonts’ is not available for package ‘gdtools’
* removing ‘/home/user/R/x86_64-pc-linux-gnu-library/3.2/gdtools’
Warning in install.packages :
  installation of package ‘gdtools’ had non-zero exit status
ERROR: dependency ‘gdtools’ is not available for package ‘flextable’
* removing ‘/home/user/R/x86_64-pc-linux-gnu-library/3.2/flextable’
Warning in install.packages :
  installation of package ‘flextable’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/RtmpN2KD39/downloaded_packages’

Upvotes: 3

Views: 2744

Answers (2)

hello_friend
hello_friend

Reputation: 5788

@Sophia Wilson Your R version is very old 3.2. Prior to installing the new packages in the manner below you should upgrade your R version. If your organisation does not permit you to upgrade the R version, you should consider learning to use Base R for as much of your work as possible, or use an IDE/environment like Jupyter Notebook.

# Install pacakges if they are not already installed: necessary_packages => character vector
necessary_packages <- c("flextable")

# Create a vector containing the names of any packages needing installation:
# new_pacakges => character vector
new_packages <- necessary_packages[!(necessary_packages %in%
                                       installed.packages()[, "Package"])]

# If the vector has more than 0 values, install the new pacakges
# (and their) associated dependencies: varied => stdout
if(length(new_packages) > 0){install.packages(new_packages, dependencies = TRUE)}

# Initialise the packages in the session: bool => stdout
lapply(necessary_packages, require, character.only = TRUE)

Upvotes: 1

MMerry
MMerry

Reputation: 334

Try installing the dependencies the error messages call out explicitly:

install.packages("systemfonts")
install.packages("gdtools")
install.packages("flextable")

Upvotes: 0

Related Questions