Loading...
Use
Create
Develop
FAQ
Troubleshooting
History: Profile_r_test6_googleVis
View page
Source of version: 6
(current)
Testing some nice graphs from Google Visualization API through R googleVis package and PluginR in Tiki. {maketoc title="" levels="2,3"} !! googleVIs R-package graphs through PluginR in Tiki !!! Section 1 - Testing the Installation This code: {CODE(colors="r",wrap="1")} {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} {CODE} Produces (nothing if the package is already installed): {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} !!! Section 2 - Scatter Chart {R(wikisyntax="0" loadandsave="1" type="text/csv" onefile="0" echo="1" removen="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} !!! Section 3 - GeoChart USA {R(loadandsave="1", wikisyntax="0", echo="1", removen="1")} 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} !!! Section 4 - Motion Chart (impressive!) {R(loadandsave="1", wikisyntax="0", echo="1", removen="1")} require(googleVis) M <- gvisMotionChart(Fruits, "Fruit", "Year", options = list(width = 550, height = 450)) print(M, "chart") {R} Once everything is ready in your system (all packages installed, etc), you'll see something like this: {img src="http://ueb.vhir.org/display577" styleimage="border" } !!! Section 5 - Spain by Autonomous Regions {R(loadandsave="1", wikisyntax="0", echo="1", removen="1")} require(googleVis) #################################################### # Por Autonomias #################################################### RegionPopular<-data.frame( Region=c('ES-IB', 'ES-CT', 'ES-EX', 'ES-TO') ,Popular=c(100,200,300, 250) ) G3 <- gvisGeoMap(RegionPopular, locationvar='Region', numvar='Popular', options=list(region="ES", dataMode="regions", width=600, height=400)) #plot(G3) print(G3, "chart") {R} !!! Section 6 - Spain by provinces {R(loadandsave="1", wikisyntax="0", echo="1", removen="1")} require(googleVis) #################################################### # Por Provincias #################################################### RegionPopular<-data.frame( Region=c('ES-PO', 'ES-SA', 'ES-VA', 'ES-TO') ,Popular=c(400,200,300, 250) ) G4 <- gvisGeoMap(RegionPopular, locationvar='Region', numvar='Popular', options=list(region="ES", dataMode="markers", width=600, height=400)) #plot(G4) print(G4, "chart") {R} {ANAME()}Section_5_-_Spain_by_cities{ANAME} !!! Section 7 - Spain by cities {R(loadandsave="1", wikisyntax="0", echo="1", removen="1")} require(googleVis) ################################################### # Por Ciudades ################################################### CiudadPopular<-data.frame( Ciudad=c('Madrid', 'Barcelona', 'Albacete') ,Popular=c(100,200,300) ) G5 <- gvisGeoMap(CiudadPopular, locationvar='Ciudad', numvar='Popular', options=list(region='ES', height=350, dataMode='markers', colors='[0xFF8747, 0xFFB581, 0xc06000]')) # plot(G5) print(G5, "chart") {R}
Menu
Featured profiles
Profiles in Wizard
Profiles Todos
Handlers
Profiles Tester
Admin
of this site
Current Profiles
Tiki version
21.x
24.x
26.x
27.x
28.x
Deprecated
25.x
state
Not fully functional yet
alpha
beta
release
type
Available in the Profiles Wizard (12+)
Featured profiles
Full profile (out of the box & ready to go)
Learning profile (to show off feature)
Long tail
Mini-profile (can be included in other)
Profile-snippet (optional but needs another "parent" profile)
Security
Tests
Latest Changes
Voting_System
test_profile_change
Test_all_tracker_field_types_profile
Scheduler_Presets_20
Tracker_as_Calendar_09
Tracker_as_Calendar_10
Hide Fixed Top Nav Bar on Scroll 19
Easy_GeoBlog
Profiles_in_Wizard
Random_header_images_14
Hide Fixed Top Nav Bar on Scroll 19
How to Create Profiles
Test_All_Plugins
JonnyBs_Luxury_Tiki_Setup
Collaborative_Multilingual_Terminology
...more
Like almost all *.tiki.org sites, you can log in with your login from
https://tiki.org
(register over there)
Search
Find
Most Popular Tags
admin
agenda
alias
antibot
antibot captcha
app
archive
articles
banning
batch
blogs
calculations
calendars
cart
categories
cluster
codemirror
comments
computation
contact us
datachannel
debug
debug console
dropdown with other
error messages
features
file galleries
forums
geo
geocms
geolocation
group homepages
group watches
header
i18n
images
item link
items list
jquery
languages
location
map
maps
maths
menu
menupage
multilingual
ol3
ol5
openlayers
paypal
plugin
plugin alias
plugin datachannel
plugin fade
plugin tabs
plugin trackerlist
pretty trackers
print
project management
r
r project
realnames
rss
static
static text
statistics
stats
structures
syntax highlighter
tablesorter
template
trackers
user watches
visualization
watches
webservice
wiki
wiki argument variables
wiki structures
Tiki Newsletter
Subscribe to the Tiki newsletter.
Don't miss major announcements and other news!