print.summarytools {summarytools} | R Documentation |
print.summarytools
Description
Display summarytools
objects in the console, in Web Browser or in
RStudio's Viewer, or write content to file.
Usage
## S3 method for class 'summarytools'
print(x, method = "pander", file = "",
append = FALSE, report.title = NA, table.classes = NA,
bootstrap.css = st_options('bootstrap.css'),
custom.css = st_options('custom.css'), silent = FALSE,
footnote = st_options('footnote'), max.tbl.height = Inf,
collapse = 0, escape.pipe = st_options("escape.pipe"), ...)
Arguments
x |
A summarytools object, created by one of the four core
functions ( |
method |
Character. One of “pander”, “viewer”,
“browser”, or “render”. Default value for the |
file |
Character. File name to write output to. Defaults to “”. |
append |
Logical. Append output to existing file (specified using the
file argument). |
report.title |
Character. For html reports, this goes into the
|
table.classes |
Character. Additional html classes to assign to
output tables. Bootstrap css classes can be used. User-defined
classes (see the custom.css argument) are also specified here. See
details section. |
bootstrap.css |
Logical. When generating an html document,
include the “includes/stylesheets/bootstrap.min.css"” file
content inside a |
custom.css |
Character. Path to a custom .css file. Classes
defined in this must also appear in the |
silent |
Logical. Set to |
footnote |
Character. Text to display just after html output
tables. The default value (“default”) produces a two-line
footnote indicating the package's name and version, the R version, and
the current date. Has no effect on ascii or markdown
content. Can contain standard html tags. Set to |
max.tbl.height |
Numeric. Maximum table height in pixels allowed
in rendered |
collapse |
Numeric. |
escape.pipe |
Logical. Set to |
... |
Additional arguments used to override attributes stored in the
object, or to change formatting via |
Details
Ascii
and markdown tables are generated using
pander
.
The following arguments can be used to override formatting attributes stored in the object:
-
style
-
round.digits
(except for dfSummary objects) -
plain.ascii
-
justify
-
split.tables
-
headings
-
display.labels
-
varnumbers
(dfSummary
objects only) -
labels.col
(dfSummary
objects only) -
graph.col
(dfSummary
objects only) -
valid.col
(dfSummary
objects only) -
na.col
(dfSummary
objects only) -
col.widths
(dfSummary
objects only) -
keep.grp.vars
(dfSummary
objects only) -
report.nas
(freq
objects only) -
display.type
(freq
objects only) -
missing
(freq
objects only)
The following arguments can be used to override heading elements:
-
Data.frame
-
Data.frame.label
-
Variable
-
Variable.label
-
Group
-
date
-
Data.type
(freq
objects only) -
Row.variable
(ctable
objects only) -
Col.variable
(ctable
objects only)
Value
NULL
when method="pander"
; A file path returned
invisibly when method="viewer"
or "browser"
. In the
latter case, the file path is also passed to shell.exec
(Windows) or system
(*nix), causing
the document to be opened in default Web browser.
Author(s)
Dominic Comtois, dominic.comtois@gmail.com
References
RStudio Summarytools on GitHub List of pander options Bootstrap Cascading Stylesheets
See Also
Examples
## Not run:
data(tobacco)
view(dfSummary(tobacco), footnote = NA)
## End(Not run)
data(exams)
print(freq(exams$gender), style = 'rmarkdown')
print(descr(exams), headings = FALSE)