Learn R Programming

longitudinalData (version 2.4.7)

regroup: ~ Function: regroup ~

Description

Remove duplicate Partition present in a ListPartition (or, by inheritance, in ClusterLongData and ClusterLongData3d objects.

Usage

regroup(object)

Value

None (this function change internaly the field of an object, it does not return any values.)

Arguments

object

[ListPartition]: object that should be simplified.

Author

Christophe Genolini
1. UMR U1027, INSERM, Université Paul Sabatier / Toulouse III / France
2. CeRSME, EA 2931, UFR STAPS, Université de Paris Ouest-Nanterre-La Défense / Nanterre / France

Details

A clusterizing algorithm can find a Partition several time. It is store several time in object ListPartition(or in ClusterLongData or in ClusterLongData3d), encombering the memory. regroup remove the duplicate Partition. Note that if the ListPartition is not ordered, then regroup sort it unless toOrder=FALSE.

References

[1] Christophe M. Genolini and Bruno Falissard
"KmL: k-means for longitudinal data"
Computational Statistics, vol 25(2), pp 317-328, 2010

[2] Christophe M. Genolini and Bruno Falissard
"KmL: A package to cluster longitudinal data"
Computer Methods and Programs in Biomedicine, 104, pp e112-121, 2011

Examples

Run this code
### Some data
data(artificialLongData)
myLd <- as.matrix(artificialLongData[,-1])
### Some clustering
part2 <- partition(rep(c("A","B","A","C"),time=50),myLd)
part3 <- partition(rep(c("A","B","C","D"),time=50),myLd)

################
### ListPartition
listPart <- listPartition()

listPart["add"] <- part2
listPart["add"] <- part3
listPart["add"] <- part2
listPart["add"] <- part3

### Some clustering has been found several time
### regroup will suppress the duplicate one
regroup(listPart)
plotCriterion(listPart)

Run the code above in your browser using DataLab