getMeans: get statistics (e.g., 'means') of groups of observations.

View source: R/getMeans.R

getMeansR Documentation

get statistics (e.g., means) of groups of observations.

Description

getMeans: compute statistics (e.g., means) by groups of observations stored in an observations * variables data-frame or matrix.

Usage

getMeans(G, factor, FUN = mean)

Arguments

G

a data frame observations * variables.

factor

a factor vector for the groups of observations

FUN

(default = mean) the statistics to be computed.

Value

a data frame with the group means as rows and the variables as columns.

Author(s)

Hervé Abdi

See Also

MakeCIEllipses

Examples

toto = matrix(round(runif(12)*10), nrow = 6, ncol = 2)
getMeans(toto, factor(c(1,1,1,2,2,2)), median) # median by groups

HerveAbdi/PTCA4CATA documentation built on July 17, 2022, 5:41 a.m.