freq {descr}R Documentation

Frequency table with barplot

Description

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

Usage

freq(x, w, plot = getOption("descr.plot"), y.axis = c("count", "percent"), ...)

Arguments

x The factor from which the frequency of values is desired.
w An optional vector for a weighted frequency table.
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.
y.axis Character string, indicating what variable to use in the y axis: "count" or "percent".
... Further arguments to be passed to barplot.

Details

A column with cumulative percents are added to the frequency table if x is an ordered factor.

Value

A list with class freqtable containing the following components:

label A character string correponding to either the attribute "label" of x or, if x does not have this attribute, the name of x.
freqtable A matrix with frequencies, sums and standard deviations.

Author(s)

Jakson A. Aquino jalvesaq@gmail.com, based on function written by Dirk Enzmann


[Package descr version 0.3.2 Index]