Learn R Programming

summarytools (version 0.6.5)

print.summarytools: Print Method for Objects of Class summarytools.

Description

Display summarytools objects in the console, in Web Browser or in RStudio's Viewer.

Usage

"print"(x, method="pander", include.footer=TRUE, silent=FALSE, ...) view(x, method = "viewer", include.footer=TRUE, silent=FALSE, ...)

Arguments

x
summarytools object that was generated with freq, descr or dfSummary.
method
One of “pander”, “viewer” or “browser”. Defaults to “pander” with print() and to “viewer” with view(). If “viewer” is used outside RStudio, Web Browser will be used instead.
include.footer
Include footer (package name and version, R version, date) in HTML tables. TRUE by default. Has no effect when method is set to “pander”.
silent
Hide console messages indicating location of temporary HTML file (relevant only when method is “viewer” or “browser”)
...
Additional arguments (not used for now).

Value

NULL when method="pander" ; a file path (returned invisibly) when method="viewer" or method="browser". In the latter case, the HTML file is passed to shell.exec, thus opening file in Web Browser.

Details

The view() wrapper function makes it more practical to generate HTML files with a single line of code (see examples).

HTML tables are generated using xtable::print.xtable and use Bootstrap CSS. Ascii / markdown tables are generated with pander::pander. See References section for a list of available pander options.

References

https://github.com/dcomtois/summarytools http://rapporter.github.io/pander/#general-options http://getbootstrap.com/css/#tables

See Also

xtable, pander

Examples

Run this code
  data(iris)
  ## Not run: view(dfSummary(iris))
  ## Not run: view(descr(iris,transpose=TRUE), "browser")
  print(freq(iris$Species), "pander")  

Run the code above in your browser using DataLab