1

I am trying to get the folowing code to work so that it will display the glyph medkit or any other icons from the FontAwesome font inside my waffle plot.

library(waffle)
library(extrafont)

font_import()


loadfonts(device = "postscript")

which does display Registering font with R using postscriptFonts(): 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)

When I run waffle I get the following errors:

Warning messages:

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

I just get a plot with boxes missing the icon inside them. What am I missing in my install of fontawesome or in my work inside RStudio?

Marcus Campbell
  • 2,746
  • 4
  • 22
  • 36
  • 1
    [Some users report](https://nsaunders.wordpress.com/2017/09/08/infographic-style-charts-using-the-r-waffle-package/#comment-32153) that explicit font import can help: `font_import(pattern = “fontawesome-webfont.ttf”)`. – neilfws Mar 26 '18 at 02:09
  • After going to the link provided by @neilfws I find a blog entitled "WHAT YOU'RE DOING IS RATHER DESPERATE" and I must predict that Tufte would be horrified. (Appears that this is a Windoze-only package.) – IRTFM Mar 26 '18 at 02:23

1 Answers1

1

So the classic have you unplugged it and plugged it back in approach worked...I restarted RStudio and now it works.