Learn R Programming

summarytools (version 0.2)

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, echo=TRUE, style="multiline", justify="left",
          max.distinct.values=10, trim.strings=FALSE,
          max.string.width=15, round.digits=2,
          file=NA, display.labels=FALSE,
          n.total="after", ...)

Arguments

x
A dataframe.
echo
If TRUE (default), pander tables will be displayed and resulting dataframe will be returned silently.
style
The style to be used in pander table. Defaults to "multiline". Alternately, 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 frequency tables 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 freq tables).
file
The text file to be written to disk. Defaults to NA.
display.labels
If TRUE,a column containing Hmisc-type labels will be displayed. Defaults to FALSE.
n.total
Where should the total number of rows be displayed. One of three options: "after" the table (default), "before" the table, or "heading" to make the heading name contain that number (c.g. "n.valid.on.250")
...
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