Learn R Programming

questionr (version 0.2)

freq: Generate frequency tables.

Description

Generate and format frequency tables from a variable or a table, with percentages and formatting options.

Usage

freq(x, digits = 1, cum = FALSE, total = FALSE,
    exclude = NULL, sort = "")

Arguments

x
either a vector to be tabulated, or a table object
digits
number of digits to keep for the percentages
cum
if TRUE, display cumulative percentages
total
if TRUE, add a final row with totals
exclude
vector of values to exclude from the tabulation
sort
if specified, allow to sort the table by increasing ("inc") or decreasing ("dec") frequencies

Value

  • The result is an object of class data.frame.

See Also

table, prop, cprop, rprop