Learn R Programming

descr (version 0.3.0)

compmeans: Means of a numerical vector according to a factor

Description

Calculates the means of a numerical vector according to a factor.

Usage

compmeans(x, f, w, digits = 6, sort = FALSE, maxlevels = 60, 
    plot = getOption("descr.plot"), xlab = deparse(substitute(f)),
    ylab = deparse(substitute(x)), ...)

Arguments

x
A numeric vector.
f
A factor.
w
Optional vector with weights.
digits
Precision of output.
sort
If TRUE, sorts the lines by the means values.
maxlevels
Maximum number of levels that x converted into factor should have.
plot
Logical: if TRUE (default), a boxplot is produced. You may put options(descr.plot = FALSE) in your .Rprofile to change the default function behavior.
xlab
A title for the x axis (see title).
ylab
A title for the y axis (see title).
...
Further arguments to be passed to boxplot.

Value

  • A object of class table.