2

I'm trying to make a wordcloud with wordcloud2 from cran page (https://cran.r-project.org/web/packages/wordcloud2/vignettes/wordcloud.html) and I've downloaded it using the commands

install.packages('devtools')
devtools::install_github("lchiffon/wordcloud2")

I've got a dataframe most_words:

> head(most_words)
  word    n
1  sir 8748
2 time 8100
3 miss 5976
4 hand 5787
5 dear 5486
6 head 5436

> dput(head(most_words))
structure(list(word = c("sir", "time", "miss", "hand", "dear", 
"head"), n = c(8748L, 8100L, 5976L, 5787L, 5486L, 5436L)), .Names = c("word", 
"n"), row.names = c(NA, 6L), class = "data.frame")

and a picture download.png on my desktop

when I run the command for wordcloud2 without using the picture I get an answer

wordcloud2(head(most_words,100), size = 0.7, shape = 'star')

but when I try to put the wordcloud on the picture I just get an empty frame with no error

wordcloud2(head(most_words,100), figPath="/Users/username/Desktop/download.png" , size = .2, color = "skyblue")

Do you have any idea why this happens? (I suspect the problem is with figpath but i don't get any errors)

Alaleh
  • 1,008
  • 15
  • 27
  • 1
    It's broken: https://github.com/Lchiffon/wordcloud2/issues/12 – lukeA May 03 '18 at 21:38
  • The link says it works with refreshing, but it doesn't for me (after many times refreshing). also on different projects by people I work with, it's working fine. I'm just wondering if there's a work around the bug – Alaleh May 03 '18 at 21:52

1 Answers1

1

Try reloading the package:

library(devtools) devtools::install_github("lchiffon/wordcloud2")

user16269
  • 31
  • 4