Learn R Programming

summarytools (version 0.2)

freq: Frequency Tables for Discrete Data and Factors

Description

Displays frequencies as well as valid/missing observation information.

Usage

freq(x, round.digits=2, echo=TRUE, style="simple",
     justify="right", plain.ascii=TRUE, file=NA,
     append=FALSE, ...)

Arguments

x
Vector of discrete (categorical) data.
round.digits
Number of sig. digits to keep in output. Defaults to 2.
echo
If TRUE (default), pander tables will be displayed.
style
Style of pander tables, one of "simple" (default), "multiline", "grid" and "rmarkdown".
justify
Pander argument. Defaults to "right".
plain.ascii
Pander argument, defaults to TRUE. When set to FALSE, markdown markup characters will appear in output tables.
file
File name to write output to. Defaults to NA. When this argument is supplied, the table is not echoed to the console. To append output into an existing text file, use append=TRUE.
append
When 'file' argument is supplied, this parameter indicates whether to append output to existing file (TRUE) or to overwrite any existing file (FALSE, default).
...
Additional arguments passed to pander().

Value

  • A frequency table of class 'matrix'.

References

https://github.com/dcomtois/summarytools

Examples

Run this code
data(iris)
  freq(iris$Species)
  freq(iris$Species, style="rmarkdown")

Run the code above in your browser using DataLab