Windows 字体数据库中未找到 Waffle 和字体系列

Waffle & font family not found in Windows font database

我正在尝试让以下代码正常工作,以便它可以在我的华夫饼图中显示字形 medkit 或来自 FontAwesome 字体的任何其他图标。

library(waffle)
library(extrafont)

font_import()


loadfonts(device = "postscript")

显示使用 postscriptFonts() 向 R 注册字体:FontAwesome

parts <- c(`Un-breached\nUS Population`=(318-11-79), `Premera`=11, `Anthem`=79)

waffle(parts/10, rows=3, colors=c("#969696", "#1879bf", "#009bda"),
   use_glyph="medkit", size=8)

当我 运行 华夫饼时,出现以下错误:

警告消息:

1: Removed 3 rows containing missing values (geom_text).

2: In grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y,  :
font family not found in Windows font database

我刚得到一个图,其中的框缺少其中的图标。我在安装 fontawesome 或在 RStudio 中工作时缺少什么?

所以经典的你拔掉它并重新插入的方法有效...我重新启动了 RStudio,现在它可以工作了。