dtables2flextable | R Documentation |
dtables2flextable(
object,
template = NULL,
caption = NULL,
use.groups = NULL,
indent = c(3, 3),
gray = TRUE,
fontsize = c(11, 11, 9),
all.name = "All"
)
object |
A return object from |
template |
Optional; a data.frame with entries 'label' (corresponding to the labels used for variables in the dtables object) in the order wanted, and (optionally) an entry 'group' if grouping is wanted. |
caption |
The caption |
use.groups |
Use grouping given by the template. Will use grouping (if such is given) if NULL |
indent |
flextable printing will recognise spaces in docx and pdf, indent is a length 2 vector. First entry is the indentation used for variables/labels with respect to row groups. The second entry is used for categorical level displayed with respect to variables/labels. |
gray |
logical; mark every other variable with gray background |
fontsize |
length 3 vector; fontsize used for header, body and footer, respectively. |
all.name |
if there is no (column) grouping, what should be the name used to the single column displayed (default "All") |
## dd is the template
dd <- data.frame(label = names(mtcars),
group = rep(c("A Foo", "The baz"), c(5,6)))
dt <- dtables(mtcars, indent = "", perc.sign = "%")
dtf <- dtables2flextable(dt, template = dd, caption = "Example",
all.name = "All cars!")
## to view:
## print(dtf, preview = "html")
## print(dtf, preview = "docx")
## print(dtf, preview = "pdf", latex_engine = "xelatex")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.