gpt4 book ai didi

r - 安装 flextable 库时出错

转载 作者:行者123 更新时间:2023-12-05 06:18:13 26 4
gpt4 key购买 nike

我在 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’

最佳答案

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

关于r - 安装 flextable 库时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61334537/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com