Loading...
 

History: Profile_r_test6_googleVis

Preview of version: 1

Testing some nice graphs from Google Visualization API through R googleVis package and PluginR in Tiki.



googleVIs R-package graphs through PluginR in Tiki

Section 1

This code:
{RR(loadandsave="1", wikisyntax="0")} # Example adapted from the ones shown here: http://code.google.com/p/google-motion-charts-with-r/ # and here: http://www.r-bloggers.com/interactive-reports-in-r-with-knitr-and-rstudio/ # # If required the first time, uncomment the following line/s to install the required R packages, and edit the path and url to suite your needs. if(!require(googleVis)){ install.packages("googleVis", repos="http://ftp.heanet.ie/mirrors/cran.r-project.org/") } {RR}


Produces (nothing if the package is already installed):
 Plugin disabled
Plugin rr cannot be executed.


Section 2

This code:
{R(wikisyntax="0" loadandsave="1")}require(googleVis) df <- data.frame(x = 1:10, y = 1:10) ## load the googleVis package suppressPackageStartupMessages(library(googleVis)) ## create the scatter chart sc <- gvisScatterChart(data=df, options=list(width=300, height=300, legend='none', hAxis="{title:'x'}", vAxis="{title:'y'}") ) ## print(sc, "chart") ## same as cat(sc$html$chart) {R}


Produces:

 Plugin disabled
Plugin r cannot be executed.


Section 3

This code:
{R(loadandsave="1", wikisyntax="0")} require(googleVis) geo <- gvisGeoChart(CityPopularity, locationvar = "City", colorvar = "Popularity", options = list(region="US", height=350, displayMode = "markers", colorAxis = "{colors: ['orange','blue']}") ) print(geo, "chart") {R}


Produces:

 Plugin disabled
Plugin r cannot be executed.


Section 4

This code:
{R(loadandsave="1", wikisyntax="0")} require(googleVis) M <- gvisMotionChart(Fruits, "Fruit", "Year", options = list(width = 550, height = 450)) print(M, "chart") {R}


Produces:

 Plugin disabled
Plugin r cannot be executed.



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

Image

History

Advanced
Information Version
Fri 14 of Oct, 2016 09:17 GMT-0000 Xavi (as xavidp - admin) Mass search and replace 6
Wed 18 of Dec, 2013 10:50 GMT-0000 Xavier de Pedro updated with a new example 5
Wed 18 of Dec, 2013 10:30 GMT-0000 Xavier de Pedro added a few more examples 4
Tue 17 of Sep, 2013 18:34 GMT-0000 Xavier de Pedro added removen param, to match new code in pluginR 0.84 3
Fri 31 of May, 2013 10:06 GMT-0000 Xavier de Pedro replaced some explicit code sections with the param echo=1 2
Tue 10 of Jul, 2012 14:47 GMT-0000 Xavier de Pedro added 1