50% off | Unlimited Data & AI Learning
Get 50% off unlimited learning

descr (version 0.3.0)

freq: Frequency table

Description

Prints a frequency table of the selected object. Optionally, the frequency might be weighted.

Usage

freq(x, w, returnMatrix = FALSE, digits = 6, na.print = "",
    plot = getOption("descr.plot"), barchart = "count", ...)

Arguments

x
The factor from which the frequency of values is desired.
w
An optional vector for a weighted frequency table.
returnMatrix
If TRUE, the return value will be of class "matrix".
digits
Minimal number of significant digits, see print.default.
na.print
A character string which is used to indicate NA values in printed output (see print.default).
plot
Logical: if TRUE (default), a barplot is produced. You may put options(descr.plot = FALSE) in your .Rprofile to change the default function behavior.
barchart
Character string, indicating what variable to use in the y axisto use: "count" or "percent".
...
Further arguments to be passed to barplot.

Value

  • An object of class freqtable if x has the attribute "label" and returnMatrix is false. Otherwise, a object of class "matrix".