Loading...
 
Testing some nice graphs from R through PluginR in Tiki.


Word-cloud art from mods.t.o


RR Code
# Includes a word cloud  with the description of the packages from http://mods.tiki.org
# Example derived from 
# http://www.r-bloggers.com/celebrating-one-year-of-blogging-with-a-word-cloud/
# and 
# http://www.sthda.com/english/wiki/word-cloud-generator-in-r-one-killer-function-to-do-everything-you-need
# Former way to do it: http://www.r-bloggers.com/word-cloud-in-r/
if(!require(RCurl)){ install.packages("RCurl", lib="/usr/lib/R/site-library", repos="http://ftp.heanet.ie/mirrors/cran.r-project.org/") }
if(!require(SnowballC)){ install.packages("SnowballC", lib="/usr/lib/R/site-library", repos="http://ftp.heanet.ie/mirrors/cran.r-project.org/") }
if(!require(XML)){ install.packages("XML", lib="/usr/lib/R/site-library", repos="http://ftp.heanet.ie/mirrors/cran.r-project.org/") }
if(!require(tm)){ install.packages("tm", lib="/usr/lib/R/site-library", repos="http://ftp.heanet.ie/mirrors/cran.r-project.org/") } 
if(!require(wordcloud)){ install.packages("wordcloud", lib="/usr/lib/R/site-library", repos="http://ftp.heanet.ie/mirrors/cran.r-project.org/") } 
if(!require(RColorBrewer)){ install.packages("RColorBrewer", lib="/usr/lib/R/site-library", repos="http://ftp.heanet.ie/mirrors/cran.r-project.org/")  }
require(RCurl)
require(SnowballC)
require(XML)
require(tm)
require(wordcloud)
require(RColorBrewer)
if (!require("SnowballC")) install.packages("SnowballC")
if (!require("RCurl")) install.packages("RCurl")
source('http://www.sthda.com/upload/rquery_wordcloud.r')
site <-"https://mods.tiki.org"
# In the next line, type should be "url", but since this keyword is blocked through Tiki inside plugin content, we bypass Tiki's check with a paste function - paste0("u", "rl") -, and approving the workaround as admin. 
res <- rquery.wordcloud(x=site, type=paste0("u", "rl"), min.freq = 8, max.words = 200, 
                        excludeWords=c("three","main","older","see","done"), colorPalette="Dark2") 
## exclude common words and restrict to words with frequency >= 8, just to get a better picture
./temp/cache/r.tiki.org/R_page76_r_test05_wordcloud/1fec963707b82d63250869a05f67a237_1.png


Once everything is ready in your system (all packages installed, etc), you'll see something like this:

Image

Show php error messages