Description Usage Arguments Details Acknowledgements Examples
View source: R/util_draw_table.R
draw_table() Pre and post version: 2.0.0 gridExtra packages
handle drawing tables differently. draw_table() determines
the installed version of gridExtra and applies the appropriate
syntax. If gridExtra version < 2.0.0 then it uses old gridExtra 
syntax to build table Grob(graphical object) else uses new syntax. 
draw_table()
| 1 | draw_table(body, heading, ...)
 | 
| body | A dataframe. Table body. | 
| heading | A string. Table title. | 
| ... | Further arguments to control the gtable. | 
prints tables without rownames.
Thanks to Ryan Welch, https://github.com/welchr/LocusZoom/issues/16
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | library(gridExtra)
## Not run: 
# Table of iris values
iris_dframe <- head(iris)
title_iris_dframe <- paste("Table: Length and width measurements (cm) of sepals and petals,",
                            "for 50 flowers from 3 species of iris (setosa, versicolor,", 
                            "and virginica).\n", sep = " ")
# Wrap title text at column 60
title_iris_dframe <- sapply(strwrap(title_iris_dframe, width = 60, simplify = FALSE), 
                            paste, collapse = "\n")
# Draw table
table_influential_studies <- draw_table(body = iris_dframe, heading = title_iris_dframe)
# Table of mtcars values
mtcars_dframe <- head(mtcars)
title_mtcars_dframe <- paste("Table: Motor Trend US magazine (1974) automobile statistics", 
                             "for fuel consumption, \nautomobile design and performance.\n", 
                             sep = " ")
# Wrap title text at column 60
title_mtcars_dframe <- sapply(strwrap(title_mtcars_dframe, width = 60, simplify = FALSE), 
                              paste, collapse = "\n")
# Draw table
table_influential_studies <- draw_table(body = mtcars_dframe, heading = title_mtcars_dframe)
## End(Not run)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.