R interface to Google's chart tools, allowing users to create interactive charts based on data frames. Charts are displayed locally via the R HTTP help server. A modern browser with an Internet connection is required and for some charts a Flash player. The data remains local and is not uploaded to Google.
The googleVis package provides an interface between R and the Google's charts tools. It allows users to create web pages with interactive charts based on R data frames. Charts are displayed locally via the R HTTP help server. A modern browser with Internet connection is required and for some charts a Flash player. The data remains local and is not uploaded to Google.
You find examples of all googleVis function on CRAN. Perhaps the best known example is the motion chart, popularised by Hans Rosling in his 2006 TED talk.
Please read Google's Terms of Use before you start using the package.
You can install the stable version from CRAN:
install.packages('googleVis')
To install the current development version from github you need the devtools package and the other packages on which googleVis depends:
install.packages(c("devtools","jsonlite", "knitr", "shiny", "httpuv"))
To install googleVis run:
library(devtools)install_github("mages/googleVis")
library(googleVis)?googleVisdemo(googleVis)
See the googleVis package vignettes for more details. For a brief introduction read the five page R Journal article and go through our tutorial. More examples have been posted on Markus' blog.
This package is free and open source software, licensed under GPL 2 or later.
googleVis documentation by Markus Gesmann & Diego de Castillo is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Based on a work at https://developers.google.com/chart/interactive/docs/gallery.
Bug fixes
o Corrected URL for gvisCalendar documentation by Google o Allow for numeric colorvar input for gvisBubbleChart to create a gradient color scale
Changes
o Updated links to omegahat from omegahat.org to omegahat.net as requested by CRAN
Changes
o Flash based charts gvisGeoMap and gvisAnnotatedTimeLine will show a warning, reminding users to switch to the HTML5 charts gvisGeoChart and gvisAnnotationChart instead.
Bug fixes
o In some cases option settings were not converted porperly into JSON objects.
Changes
o Changed package dependency from RJSONIO to jsonlite.
o Change demo AnimatedGeoMap to AnimatedGeoChart
Bug fixes
o Ordered factors were ignored. Thanks to Carsten Langer for reporting this issue.
Changes
Added note section on width and height to help file of gvisIntensityMap. Thanks to Sarang Brahme for his comment.
Updated NAMESPACE file to comply with new R CMD checks in R-3.3.0
Changes
Changes
Updated DESCRPITION file to comply with new CRAN policy
Clarified setting parameters in help file. Thanks to Nick Salkowski for his suggestions.
Changes
Bug Fixes
Changes
Bug Fixes
README.md when converted to (X)HTML using a current version of pandoc showed minor problems when validated using W3C Markup Validator.
In some case when no xvar and yvar arguments where provided for core charts the output wasn't sensible. This bug was introduced with version 0.5.3. Thanks to stanstrup for reporting this issue.
Changes
Changes
Default chart width is set to 'automatic' instead of 500 pixels.
Intervals for columns roles have to end with the suffix ".i", with i being an integer. Several interval columns are allowed, see the Roles demo and vignette for more details.
Bug Fix
The order of y-variables in core charts wasn't maintained. Thanks to John Taveras for reporting this bug.
Width and height of googleVis charts were only accepted in pixels, although the Google Charts API uses standard HTML units (for example, '100px', '80em', '60', 'automatic'). If no units are specified the number is assumed to be pixels. This has been fixed. Thanks to Paul Murrell for reporting this issue.
Changes
Fixed minor formatting issues in documentation and vignettes.
Added examples in demo googleVis to show how to customize points and lines and to the help files of gvisLineChart and gvisScatterChart.
NEW FEATURES
New functions gvisSankey, gvisAnnotationChart, gvisHistogram, gvisCalendar and gvisTimeline to support the new Google charts of the same names (without 'gvis').
New demo Trendlines showing how trend-lines can be added to Scatter-, Bar-, Column-, and Line Charts.
New demo Roles showing how different column roles can be used in core charts to highlight data.
New vignettes written in R Markdown showcasing googleVis examples and how the package works with knitr.
Changes
The help files of gvis charts no longer show all their options, instead a link to the online Google API documentation is given.
Updated googleVis demo
All googleVis output will be displayed in your default browser.
In previous versions of googleVis output could also be displayed
in the preview pane of RStudio. This feature is no
longer available with the current version of RStudio, but is likely to
be introduced again with the release of RStudio version 0.99 or higher.
Changes
New option 'googleVis.viewer' which controls the default output of the googleVis plot method. On package load it is set to getOption("viewer"). It you use RStudio, then its viewer pane will be used for displaying non-Flash charts. Set options("googleVis.viewer"=NULL) and the googleVis plot function will open all output in the default browser again.
The package start-up message makes the user aware of the default viewer option.
Added example to gvisMap that illustrates how the icon can be changed.
Changes
Bug Fixes
NEW FEATURES
gvisTable() gained new parameter formats, which allow users to specify the format of numbers displayed in a table. Thanks to Jacqueline Buros for providing ideas and code.
Doughnut charts are now possible as pie charts with a hole.
Changes
New examples for gvisBarChart, gvisColumnChart, gvisComboChart demonstrating how to change the width of bars
Extended FAQ section
NEW FEATURES
NEW FEATURES
Changes
Bug Fixes
NEW FEATURES
Changes
In order to support shiny the order of the elements of the gvis*()$html$chart vector changed. The positions of jsChart and jsFooter have been swapped.
The load mechanism for the Google API changed from http to https again. Thanks to Jacques Philip.
The package dependencies changed to imports statements in DESCRIPTION. Thanks to Suraj Gupta for pointing this out.
The R.rsp example in demo googleVis has been moved into its own demo Rrsp.
A FAQ and shiny section has been added to the vignette.
Bug Fixes
jsDisplayChart didn't check if the google visualization function is already loaded. Many thanks to Mark Melling for reporting the issue and providing a solution.
The demo WorldBank didn't download all data but only the first 12000 records. Many thanks to John Maindonald reported this issue.
Changes
Bug Fixes
NEW FEATURES
Changes
The tag argument of print.gvis can be set globally from outside the function via options(gvis.print.tag)
The vignette has a new section describing how to set the behaviour of plot.gvis and print.gvis via options(gvis.plot.tag), options(gvis.print.tag) respectively. The section describing how googleVis can be used with knitr has been extended and an additional example included.
plot.gvis can open any html file now, not just gvis-objects. Like with gvis-object it will copy the file into a temporary directory and display it via the R HTTP server.
Bug Fixes
The argument 'browser' introduced in version 0.3.0 has been removed again. The argument was set by default to the output of getOptions('browser'), if interactive() returned TRUE, otherwise to 'false'. The function getOptions('browser') returns either a string or a function call. The later caused an error message, as experienced with RStudio and RGui.exe. The check is now handled internally by plot.gvis.
Thanks to Sebastian Kranz for reporting this bug.
NEW FEATURES
plot.gvis has a new argument 'browser'. The argument is passed on to the function browseURL. The 'browser' argument is by default set based on the output of interactive(). This prevents R CMD CHECK trying to open browser windows during the package checking process. See the help file of plot.gvis for more details. Thanks to Henrik Bengtsson for his comments and suggestions.
gvisMotionChart has new arguments xvar, yvar, colorvar and sizevar. Those arguments are optional and set the various dimensions of a motion chart, similar to those in gvisBubbleChart. Thanks to Sebastian Kranz for the idea and initial code.
gvisGeoChart accepts tooltip.triggers following an update of the Visualisation API by Google, 24 September 2012
R data frames are transformed into JSON objects using a new function provided by Sebastian Kranz and Wei Luo. The new function speeds up the googleVis functions.
Changes
Changed the load mechanism for the Google API from http to https. Thanks to Erik Bülow for pointing this out (Issue 19).
Changed example in help file of gvisMap to show how to include html code in tooltip.
Bug Fixes
Changes
Added sections with information to 'knitr' and 'Rook' to vignette
Added example to gvisMerge demonstrating the use of 'Reduce'
Bug Fixes
Data frames with one row only were not displayed in a chart. Thanks to Oliver Jay and Wai Tung Ho for reporting this issue.
Fixed earth quake example, using data from https://ds.iris.edu/seismon/eventlist/index.phtml, Mag was read as factor rather than numeric
Changes
Updated example in help file of gvisGeoChart for individual colour axis
Updated links to Google API pages
NEW FEATURES
Changes
Updated documentation following a new version of the Google API on 22 February 2012.
Moved vignette from folder /inst/doc to /vignettes
NEW FEATURES
Added gradient color mode to bubble chart.
Geo chart: o Region interactivity in marker mode is now disabled by default. How to keep the old behavior? Set the enableRegionInteractivity option to true.
o Markers are now opaque by default. How to keep the old behaviour? Set the markerOpacity option to 0.5.
o Marker size is now between 3 and 12 pixels by default. How to keep the old behavior? Set the sizeAxis option to {minSize: 2, maxSize: 30}.
o A magnifying glass is now opened when the user hovers over cluttered markers (excluding IE<=8). How to keep the old behaviour? Set the magnifyingGlass option to {enable: false}.
o Maps are not stretched by default anymore, but rather kept at the original aspect ratio. How to keep the old behavior? Set the keepAspectRatio option to false.
Changes
NEW FEATURES
Changes
NEW FEATURES
Bug Fixes
Changes
Changes
Updated section 'Using googleVis output with Google Sites, Blogger, etc.' vignette
Updated example for gvisMotionChart, showing how the initial chart setting can be changed, e.g to display a line chart.
New example for gvisAnnotatedTimeLine, showing how to shade areas. Thanks to Mike Silberbauer for providing the initial code.
NEW FEATURES
Changes
The documentation of googleVis has been update to reflect a new version of the Google Visualisation API which was published on 13 July, see https://developers.google.com/chart/interactive/docs/release_notes?csw=1#july-13-2011. Here are some of the most interesting features:
Updated vignette with new sections on
Updated warning section for gvisTreeMap
NEW FEATURES
Changes
Updated package welcome message. The message asks the user to read Google's Visualisation and Maps API Terms of Use before she uses the functions of the googleVis package.
The caption gvis-plots contain an additional link to Google's data policy.
New example for gvisBarChart using the XML package to chart online data from Wikipedia
Changes
The vignette includes new sections describing:
Clarified documentation for Flash based charts in help files of motion chart, geo map, annotated time line.
NEW FEATURES
BUG FIXES
Changes
NEW FEATURES
New interfaces to three more interactive Google charts:
New function 'gvisMerge' to align two charts next to each other
NEW FEATURES
New interfaces to more interactive Google charts:
New demo 'AnimatedGeoMap'. The demo shows how a Geo Map can be animated with additional JavaScript. Thanks to Manoj Ananthapadmanabhan and Anand Ramalingam, who provided the idea and initial code.
BUG FIXES
Changes
plot.gvis no longer writes into the package folder. Instead temporary files are created. This overcomes the need to install the package into a directory with write access. Many thanks to Ben Bolker for this suggestion and code contribution.
plot.gvis no longer requires the web server provided by the R.rsp package to display the visualisation output. Instead it uses the internal R HTTP help server. Many thanks to John Verzani for this suggestion and code contribution.
R >= 2.11.0 is required to plot googleVis output, as it uses the internal R HTTP help server.
Updated vignette with a section on how to use googleVis with RApache and brew
NEW FEATURES
The plot function generates a web page which includes a link to the HTML code of the chart. Many thanks to Henrik Bengtsson for this suggestion.
gvis visualisation functions have a new argument 'chart id', to set the chart id of the exhibit manually.
gvis functions return more details about the visualisation chart in a structured way. Suppose x is a 'gvis' object, than x$html$chart is a named character vector of the chart's JavaScript building blocks and html tags.
print.gvis has a new argument 'tag', which gives the user more control over the output
Brew example files in: system.file("brew", package = "googleVis")
BUG FIXES
Changes
NEW FEATURES
BUG FIXES
Changes
NEW FEATURES
Changes
NEW FEATURES
Changes
USER-VISIBLE CHANGES
NEW FEATURES
Changes
NEW FEATURES
USER-VISIBLE CHANGES
First public version.