You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

加载epiR包遇报错:'match_fonts'未被systemfonts命名空间导出

解决epiR包加载时match_fonts导出错误的方案

问题根源

这个错误是因为epiR依赖的systemfonts包版本更新后,移除了match_fonts导出函数,但当前安装的epiR版本仍在调用该函数,导致懒加载失败。

最佳解决办法

1. 更新epiR到兼容最新systemfonts的版本

优先尝试更新epiR到最新稳定版,新版本已适配systemfonts的API变化:

install.packages("epiR")

若CRAN安装失败,可尝试安装GitHub开发版:

# 先安装devtools(未安装的话)
install.packages("devtools")
devtools::install_github("epirhandbook/epiR")

2. 降级systemfonts到保留match_fonts的版本

如果暂时不想更新epiR,可将systemfonts降级到仍保留match_fonts的旧版本(如v1.0.4):

# 先安装remotes(未安装的话)
install.packages("remotes")
remotes::install_version("systemfonts", version = "1.0.4")

安装完成后重启R,再尝试加载epiR:

library(epiR)

3. 清理旧包缓存并重新安装依赖

若上述方法无效,可清理包缓存后重新安装:

  • 关闭R,找到Windows下的R包安装目录(通常为Documents/R/win-library/4.3)
  • 删除epiR和systemfonts对应的文件夹
  • 重启R,重新安装epiR(会自动安装兼容的依赖版本)

注意事项

  • 操作前建议备份当前包环境,避免影响其他已安装的包
  • 确保操作基于R 4.3.3环境,部分过旧的包版本可能不再支持该R版本

内容的提问来源于stack exchange,提问作者K Maciejewski

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.18 19:32:32