【问题标题】:Getting error while installing flextable library安装 flextable 库时出错
【发布时间】:2020-08-03 16:02:27
【问题描述】:

在 r studio 安装 flextable 库时出现以下错误。

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’

【问题讨论】:

    标签: r dataframe dplyr tidyverse


    【解决方案1】:

    尝试安装错误消息显式调用的依赖项:

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

    【讨论】:

    • 我已经试过了,收到错误Warning in install.packages : installation of package ‘systemfonts’ had non-zero exit status The downloaded source packages are in ‘/tmp/RtmpE9BewA/downloaded_packages’
    【解决方案2】:

    @Sophia Wilson 您的 R 版本非常旧 3.2。在以下列方式安装新软件包之前,您应该升级您的 R 版本。如果您的组织不允许您升级 R 版本,您应该考虑学习在尽可能多的工作中使用 Base R,或者使用像 Jupyter Notebook 这样的 IDE/环境。

    # 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)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-02-14
      • 2019-01-12
      • 2019-11-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多