Let us first load the package and set the option plot.gvis
to chart
so that only the chart fragment is printed.
require(googleVis)
options(gvis.plot.tag = "chart")
Now it is time to generate a chart
M1 <- gvisMotionChart(Fruits, idvar = "Fruit", timevar = "Year")
plot(M1)