googleVis 0.4.4 released with new formatting options for tables
[This article was first published on mages' blog, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Over the weekend googleVis 0.4.4 found its way to CRAN. The function Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
gvisTable
gained a new argument formats
that allow users to define the formats numbers displayed in tables. Thanks to J. Buros, who contributed the code.Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Session Info
R version 3.0.1 (2013-05-16) Platform: x86_64-apple-darwin10.8.0 (64-bit) locale: [1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods [7] base other attached packages: [1] googleVis_0.4.4 loaded via a namespace (and not attached): [1] RJSONIO_1.0-3 tools_3.0.1
To leave a comment for the author, please follow the link and comment on their blog: mages' blog.
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.