# install.packages('googleVis')
library(googleVis)
library(MASS)
data(Animals)
Here is a basic gvisTable:
tab1 <- gvisTable(Animals, options = list(width = 600, height = 650,
page = "enable", pageSize = nrow(Animals)))
print(tab1, "chart")
?print.gvis explains some of the options for printing the gvis object. tag="chart" option is required for R Markdown documents as this means that the output is just what is required for the object, rather than a complete HTML page as is the default.Another ultra simple table
simpleData <- data.frame(matrix(1:9, nrow = 3))
tab2 <- gvisTable(simpleData, options = list(width = 600, height = 300))
print(tab2, "chart")
Animals$logbody <- log(Animals$body, 10)
Animals$logbrain <- log(Animals$brain, 10)
print(gvisScatterChart(Animals[, c("logbody", "logbrain")]), "chart")