Reputation: 1695
Being new to R, I am lacking a few basics. Is it possible to make a wordcloud on a dataframe? my data is like:
X x
a 10
b 8
c 6
d 4
Can i make a workcloud on the above data where X is the word and x is its frequency?
Upvotes: 0
Views: 1013
Reputation: 2359
Just try for a sample
abc<-data.frame(X=LETTERS[1:26],x=sample(1:26))
wordcloud(abc$X,abc$x,scale = c(5,.5),min.freq = 2,colors = brewer.pal(10,"Paired"))
Upvotes: 2
Reputation: 23598
You can. Just specify
wordcloud(words = data$X, freq = data$x)
Be aware that by default the minimum frequency is set to 3. You might want to adjust this. just check the help.
Upvotes: 2