Reputation: 2832
How can I make sure that the output of wordcloud2::wordcloud2()
appears in my RMarkdown (HTML) document?
It renders fine in RStudio, including in the preview of the RMarkdown document, but when I upload it to my netlify site with blogdown, it doesn't show (see here, bottom of the post). Any ideas?
Edit: here's the code I'm using. Like I said, it works perfectly in RStudio, just not on the website itself.
library(tidyRSS)
five38 <- tidyfeed("http://fivethirtyeight.com/all/feed")
library(wordcloud2)
topics <- five38$item_category1 %>% append(five38$item_category2) %>%
append(five38$item_category3) %>%
append(five38$item_category4) %>%
append(five38$item_category5)
Topics <- data_frame(
words = topics
) %>%
filter(!is.na(words)) %>%
group_by(words) %>%
tally()
wordcloud2(Topics)
Upvotes: 5
Views: 1866
Reputation: 89
```{r}
library(htmlwidgets)
install.packages("webshot")
webshot::install_phantomjs()
library(wordcloud2)
hw = wordcloud2(demoFreq,size = 3)
saveWidget(hw,"1.html",selfcontained = F)
webshot::webshot("1.html","1.png",vwidth = 700, vheight = 500, delay =10)
```

ok, i found this way to solve this problem from the author of wordcloud2.
Upvotes: 3