问题
I'm following this instruction : link
and I have this code:
library(waffle)
library(extrafont)
font_import()
# use this if things look odd in RStudio under Windows
loadfonts(device = "win")
waffle(c(50, 30, 15, 5), rows = 5, use_glyph = "fa-car", glyph_size = 40,
title = "Look I made an infographic using R!")
And I get this as result:
"Error: FontAwesome not found. Install via: https://github.com/FortAwesome/Font-Awesome/tree/master/fonts"
I also check if I Font Awesome installed or not with this code:
# check that Font Awesome is imported
fonts()[grep("Awesome", fonts())]
and I received this message: " 1 "Font Awesome 5 Brands" "Font Awesome 5 Free" "
回答1:
I don't know if this is still an issue for you or not, but it certainly was for me, and I eventually got it to work! I think there's something in the package that's set up a bit too specifically for V4 of FontAwesome. The upgrade to V5 changes some naming conventions and in doing so, I'm pretty sure it's mucked around with the package.
Easiest solution? I just had to install v4 of FontAwesome. You can find it here.
With that installed, some combination of loading the libraries emojifont
and extrafont
got this working for me. Good luck!
来源:https://stackoverflow.com/questions/51964889/can-not-load-font-awesome-in-r-and-rstudio