eclairs
eclairs

Reputation: 1695

Wordcloud on dataframe in R

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

Answers (2)

Arun kumar mahesh
Arun kumar mahesh

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"))

enter image description here

Upvotes: 2

phiver
phiver

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

Related Questions