R wordcloud

A piece of R code to beat the rut of my day job.

I have a document in the directory.

 transcript<-Corpus(DirSource("~/Documents/Algorithms/rcloud/"))
 transcript<-tm_map(transcript,stripWhitespace)
 transcript<-tm_map(transcript,tolower)
 transcript<-tm_map(transcript,stemDocument)
 transcript<-tm_map(transcript,PlainTextDocument)
 wordcloud(transcript,scale=c(5,0,5),max.words=100,random.order=FALSE,rot.per=0.35,use.r.layout=FALSE,colors=brewer.pal(8,"Dark2"))

wordcloud

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

%d bloggers like this: