Dataframe Summaries, Frequency Tables and Descriptive Stats with Various Output Formats

Built around three key functions: 1) freq() generates frequency tables reporting counts and proportions (including cumulative) for factors and other discrete data; 2) descr() gives all common central tendency statistics and measures of dispersion for numerical data; 3) dfSummary() gives as much information as possible on a dataframe's columns in a legible table. freq() and descr() support weights, and all three functions support 'Hmisc' or 'pander' labels. A variety of output formats are available (plain text, 'rmarkdown' and HTML). An additional misc function, what.is(), displays all common properties of an object (its class, type, mode, attributes, etc.) and extends the base is() function, checking the object against most is.() functions.


News

Fixed a problem with dfSummary() which arose when number of factors exceeded max.distinct.values. Improved the way dfSummary() reports frequencies on character variables. Fixed problems with outputs when using weights. Added hashtags to table headings to improve markdown integration. Added an option to generic print() function to suppress the footer in HTML outputs.

Added Introduction vignette. Fixed markdown output that would not render strings such as . Improved multiline tables linefeeds. Introduced cleartmp() function to delete temporary HTML files used with print method "viewer" or "browser". Modifications to sample datasets. Bootstrap stylesheets now only include table-specific elements. Changed the way method="browser" sends file path to browser for better cross-platform compatibility. Improved results when using by(). Since version 0.5 was only made available through devtools::install_github(), please see changes for that version if updating from CRAN.

Function descr() now also supports weights. Output from what.is() has been simplified. Other changes are transparent to the user (but make the internals more consistent across functions).

Added cat() functions to fully support knitr's document generation. Also added sample datasets so that users can experiment using summarytools functions with them. freq() now supports weights.

Another round of major changes.

  • Bringing in HTML table built with htmltools and viewable in RStudio's Viewer
  • function desc is renamed descr (mainly to avoid conflict with plyr's desc)
  • argument "echo" is deprecated; either display with pander or use as.table()
  • Returned objects are now of class "summarytools" and have several attributes that are used by print.summarytools
    • st.type : one of "freq", "descr" and "dfSummary"
    • date : date at which the function was called
    • var.name & var.label : for 'freq', and also 'desc' when a single vector is used.
    • pander.args : 'style', 'justify', 'plain.ascii', 'split.table'
  • print.summarytools has argument "method" that can be one of "pander", "viewer", or "browser", the last two being used to display an HTML version of the output, using bootstrap's css (getbootstrap.com)
  • rows indexing is "detected" and reported (function .parse.arg.x takes care of this)
  • rounding now only occurs at the printing stage

Several major changes since version 0.1

  • 'unistats' is now called 'desc'.
  • 'frequencies' is now called 'freq'.
  • 'properties' is now called 'prop'.
  • shortcuts have been added to keep backward-compatibility.
  • 'desc' now accepts dataframes as first argument; factors and character columns will be ignored.
  • 'desc' can be transposed to suit one's preferences.
  • 'freq' just returns a matrix-table, not a list anymore.
  • in 'desc' and 'freq', no more argument 'display.label'. Those are displayed automatically when present.
  • rapportools is used instead of Hmisc for variable labels
  • function 'properties' was removed for now. Maybe reintegrated in a future update.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("summarytools")

0.6.5 by Dominic Comtois, 3 months ago


https://github.com/dcomtois/summarytools


Report a bug at https://github.com/dcomtois/summarytools/issues


Browse source code at https://github.com/cran/summarytools


Authors: Dominic Comtois


Documentation:   PDF Manual  


GPL-2 license


Imports Hmisc, methods, pryr, pander, xtable, rapportools, rstudioapi, utils, matrixStats

Depends on htmltools

Suggests knitr, rmarkdown


See at CRAN