Learn R Programming

summarytools (version 0.3)

dfSummary: Dataframe Summary

Description

Summary of a dataframe consisting of: variable names and labels, factor levels, frequencies or numerical summary statistics, and valid/missing observations information.

Usage

dfSummary(x, style="multiline", justify="left",
          max.distinct.values=10, trim.strings=FALSE,
          max.string.width=15, round.digits=2,
          split.cells=40, display.labels=FALSE,
          file=NA, append=FALSE,
          escape.pipe=FALSE, ...)

Arguments

x
A dataframe.
style
The style to be used in pander table. Defaults to multiline. Alternatively, use grid; other styles (simple and rmarkdown are not supported.
justify
pander argument. Defaults to left.
max.distinct.values
The maximum number of items to be displayed in the frequency cell. If variable has more distinct values, no frequency will be shown (only a message stating the number of distinct values).
trim.strings
For character variables, remove any white space at the beginning or end of the string. This will impact the frequencies so interpret the frequencies cell accordingly. Defaults to FALSE.
max.string.width
Limits the number of characters to display in the frequency tables. Defaults to 15.
round.digits
Number of digits for rounding (used in numerical stats and in frequency tables).
split.cells
pander argument. Number of characters allowed on a line before splitting the cell. Defaults to 40.
display.labels
If TRUE, variable (as defined with rapportools or Hmisc's label function) labels will be displayed. Defaults to FALSE.
file
The text file to be written to disk. Defaults to NA.
append
When file argument is supplied, this indicates whether to append output to existing file (TRUE) or to overwrite any existing file (FALSE, default). If TRUE and no file exists, a new file will be crea
escape.pipe
Only useful when style='grid' and file argument is not NA, in which case it will escape the pipe character (|) to allow Pandoc to correctly convert multiline cells.
...
Additional arguments passed to pander.

Value

  • A dataframe containing as many rows as there are columns in x.

References

https://github.com/dcomtois/summarytools

See Also

summary.data.frame

Examples

Run this code
data(iris)
  dfSummary(iris)

Run the code above in your browser using DataLab