Book Image

Learning Shiny

By : Hernan Resnizky
Book Image

Learning Shiny

By: Hernan Resnizky

Overview of this book

Table of Contents (19 chapters)
Learning Shiny
Credits
About the Author
Acknowledgements
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
1
Introducing R, RStudio, and Shiny
Index

A walk around the googleVis package


googleVis is a package in R that mainly interfaces R and Google Chart's API. This means that you can create Google charts within R via high-level functions. This has the great advantage of not needing to make service calls and parse the objects to generate the charts. Unlike traditional plotting in R, Google charts are displayed in a browser. In fact, their plot creation functions do not display a plot directly but generate an HTML code.

When working under R but not in a Shiny application, a plot() call with the HTML object as argument automatically opens a browser with the corresponding plot. The following is an example of this:

data(iris)

iris.table <- aggregate(Petal.Length ~ Species, data=iris, FUN="mean")

column.chart <- gvisColumnChart(iris.table,"Species","Petal.Length")
plot(column.chart)

As it was said previously, gvisColumnChart() does not generate a plot by itself but it generates a list with an HTML code that will generate the corresponding...