I have this pie chart:
```{r pie, dev = 'png'}
slices <- c(10, 12, 4, 16, 8)
lbls <- c("US", "UK", "Australia", "Germany", "France")
pie(slices, labels = lbls)
```
I set the graphics device to PNG because PDF is weird in blogdown/html. I tried this code chunk in bookdown::pdf_document2
output and it worked fine. However, I get this error when trying to render it in blogdown:
> blogdown::build_site(build_rmd = "newfile")
Rendering content/blog/2022-05-04-gentoo-linux-the-best-operating-system-ever-made/index.Rmd... Linking to librsvg 2.54.0
Quitting from lines 22-25 (index.Rmd)
Error in text.default(1.1 * P$x, 1.1 * P$y, labels[i], xpd = TRUE, adj = ifelse(P$x < :
X11 font -adobe-helvetica-%s-%s-*-*-%d-*-*-*-*-*-*-*, face 1 at size 12 could not be loaded
Calls: local ... eval_with_user_handlers -> eval -> eval -> pie -> text -> text.default
Execution halted
Error: Failed to render content/blog/2022-05-04-gentoo-linux-the-best-operating-system-ever-made/index.Rmd
Execution halted
I am not sure why it's giving me an error about Adobe Helvetica. If I set the device to 'svglite'
or 'pdf'
, it renders fine. But I want to set it to 'png'
without getting this error.