groupMeans: Group Means

Description Usage Arguments Value Author(s) See Also Examples

View source: R/groupMeans.R

Description

Calculates means for each group

Usage

1
  groupMeans(variables, group, na.rm = FALSE)

Arguments

variables

matrix or data frame with explanatory variables (may contain missing values)

group

vector or factor with group memberships

na.rm

logical indicating whether missing values should be removed

Value

matrix of group means (with variables in the rows, and groups in the columns)

Author(s)

Gaston Sanchez

See Also

groupVars, groupStds, groupMedians, groupQuants

Examples

1
2
3
4
5
6
7
8
## Not run: 
  # dataset iris
  data(iris)

  # group means
  groupMeans(iris[,1:4], iris[,5])
  
## End(Not run)

Example output

             setosa versicolor virginica
Sepal.Length  5.006      5.936     6.588
Sepal.Width   3.428      2.770     2.974
Petal.Length  1.462      4.260     5.552
Petal.Width   0.246      1.326     2.026

DiscriMiner documentation built on May 1, 2019, 10:32 p.m.