draw_table {getmstatistic} | R Documentation |
Helper function to draw table grobs.
Description
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()
Usage
draw_table(body, heading, ...)
Arguments
body |
A dataframe. Table body. |
heading |
A string. Table title. |
... |
Further arguments to control the gtable. |
Details
prints tables without rownames.
Acknowledgements
Thanks to Ryan Welch, https://github.com/welchr/LocusZoom/issues/16
Examples
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)
[Package getmstatistic version 0.2.2 Index]