{RR(loadandsave="1", wikisyntax="0")}
# Includes a word cloud with the description of the packages from http://mods.tiki.org
# Example adapted from the ones shown here: http://www.r-bloggers.com/word-cloud-in-r/
# If required the first time, uncomment the following 4 lines to install the required R packages
#install.packages("XML")
#install.packages("tm")
#install.packages("wordcloud")
#install.packages("RColorBrewer")
require(XML)
require(tm)
require(wordcloud)
require(RColorBrewer)
u2 = "http://mods.tiki.org/"
t2 = readHTMLTable(u2)
ap.corpus2 <- Corpus(DataframeSource(data.frame(t2[[1]][6])))
ap.corpus2 <- tm_map(ap.corpus2, removePunctuation)
ap.corpus2 <- tm_map(ap.corpus2, tolower)
ap.corpus2 <- tm_map(ap.corpus2, function(x) removeWords(x, stopwords("english")))
ap.tdm2 <- TermDocumentMatrix(ap.corpus2)
ap.m2 <- as.matrix(ap.tdm2)
ap.v2 <- sort(rowSums(ap.m2),decreasing=TRUE)
ap.d2 <- data.frame(word = names(ap.v2),freq=ap.v2)
#table(ap.d2$freq)
pal2 <- brewer.pal(8,"Dark2")
#png("wordcloud_packages.png", width=1280,height=800)
wordcloud(ap.d2$word,ap.d2$freq, scale=c(8,.2),min.freq=3,
max.words=Inf, random.order=FALSE, rot.per=.15, colors=pal2)
#dev.off()
{RR}
Produces:
Plugin disabled
Plugin rr cannot be executed.
And once everything is ready in your system (all packages installed, etc), you'll see something like this: