splitgroups: splitgroups

Description Usage Arguments Value Examples

Description

If the p variables of a data matrix of dimension (n,p) are separated into G groups, this functions splits this data matrix into G datasets according the groups membership.

Usage

1
  splitgroups(data, groups, name.groups)

Arguments

data

the a data matrix into G datasets with n rows and p columns.

groups

a vector of size p whose values indicate at which group belongs each variable.

name.groups

a vector of size G which contains names for each group we want to create. The names are given in the increasing order of the numbers of the groups.

Value

data.groups

a list of G data matrix: one matrix for each group.

listvar.groups

The list of the variables in each group.

Examples

1
2
3
4
data(decathlon)
split <- splitgroups(decathlon,groups=c(rep(1,10),2,2,3),
          name.groups=c("Epreuve","Classement","Competition"))
split$data.groups$Epreuve

PCAmixdata documentation built on May 2, 2019, 12:38 p.m.