Learn R Programming

summarytools (version 0.3)

freq: Frequency Tables for Factors and other Discrete Data

Description

Displays frequencies as well as valid/missing observation information.

Usage

freq(x, round.digits=2, 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.
style
Style of pander tables, one of simple (default), multiline, grid and rmarkdown.
justify
pander argument. Defaults to "right".
plain.ascii
pander argument; when results are displayed in console, this avoids having markdown markup characters int the tables. Defaults to TRUE.
file
File name to write output to. Defaults to NA. To append output to an existing text file, use append=TRUE.
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
...
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