Learn R Programming

summarytools (version 0.1)

frequencies: Frequency Tables for Discrete Data and Factors.

Description

Displays frequencies as well as valid/missing obs. information. Optionally uses package 'pander' to display pretty tables.

Usage

frequencies(x, round.digits=2, echo=TRUE, style="grid", justify="right",
            plain.ascii=TRUE, display.label=FALSE, ...)

Arguments

x
Atomic object of discrete (categorical) data.
round.digits
Number of sig. digits to keep. Defaults to 2.
echo
If TRUE, pander tables will be displayed. Defaults to TRUE.
style
Style of pander tables. Defaults to "grid".
justify
Pander argument. Defaults to "right".
plain.ascii
Pander argument. Defaults to TRUE.
display.label
If TRUE, Hmisc-type labels will be displayed. Defaults to FALSE.
...
Additional arguments passed to pander().

Value

  • A list containing the variable's name, label if applicable, frequency table and information on valid vs observations.

Examples

Run this code
colors <- c("blue","red","blue","yellow",NA)
frequencies(colors)
frequencies(colors, echo=TRUE)

Run the code above in your browser using DataLab