I'm trying to show a wordcloud2 wordcloud, but it only works in an html-knitted Rmd file. This works:
---
title: "Untitled"
output: html_document
---
```{r wordcloud}
library(wordcloud2)
wordcloud2(demoFreq)
```
But this does not:
---
title: "Untitled"
output: pdf_document
---
```{r wordcloud}
library(wordcloud2)
wordcloud2(demoFreq)
```
It will knit with always_allow_html: yes in the YAML, but the wordcloud doesn't show up:
---
title: "Untitled"
output: pdf_document
always_allow_html: yes
---
```{r wordcloud}
library(wordcloud2)
wordcloud2(demoFreq)
```
I'm thinking maybe to save the figure as an image, then load it in the .Rmd, but that seems clumsy. Better ideas?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…