Skip to content

Instantly share code, notes, and snippets.

@OrenBochman
Forked from mages/formattedtable.R
Created September 15, 2013 17:30
Show Gist options
  • Save OrenBochman/6572775 to your computer and use it in GitHub Desktop.
Save OrenBochman/6572775 to your computer and use it in GitHub Desktop.
dat <- data.frame(Product=c("Milk", "Butter", "Yoghurt", "<b>Sum</b>"),
Revenue=c(2230, 43908, 231, 46369))
dat <- within(dat, {'% of Revenue' <- c(Revenue / Revenue[4])})
library(googleVis)
tbl <- gvisTable(dat, options=list(width=300, height=150),
formats=list(Revenue="#,###", '% of Revenue'='#.#%'),
chartid="formattedtable")
plot(tbl)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment