Learn R Programming

longitudinalData (version 2.4.7)

ListPartition-class: ~ Class: ListPartition ~

Description

An object of class ListPartition contain several liste of Partition sorted by cluster numbers.

Arguments

Objects from the Class

Objects are mainly design to store the numerous Partition found by kml or kml3d.

Slots

criterionActif

[character]: Store the criterion name that will be used by fonctions that need a single criterion (like plotCriterion or ordered).

initializationMethod

[vector(chararcter)]: list all the initialization method that has allready been used to find some Partition (usefull to not run several time a deterministic method).

sorted

[logical]: are the Partition curently hold in the object sorted in decreasing (or increasing, according to criterionActif) order ?

c1

[list(Partition)]: list of Partition with 1 clusters.

c2

[list(Partition)]: list of Partition with 2 clusters.

c3

[list(Partition)]: list of Partition with 3 clusters.

c4

[list(Partition)]: list of Partition with 4 clusters.

c5

[list(Partition)]: list of Partition with 5 clusters.

c6

[list(Partition)]: list of Partition with 6 clusters.

c7

[list(Partition)]: list of Partition with 7 clusters.

c8

[list(Partition)]: list of Partition with 8 clusters.

c9

[list(Partition)]: list of Partition with 9 clusters.

c10

[list(Partition)]: list of Partition with 10 clusters.

c11

[list(Partition)]: list of Partition with 11 clusters.

c12

[list(Partition)]: list of Partition with 12 clusters.

c13

[list(Partition)]: list of Partition with 13 clusters.

c14

[list(Partition)]: list of Partition with 14 clusters.

c15

[list(Partition)]: list of Partition with 15 clusters.

c16

[list(Partition)]: list of Partition with 16 clusters.

c17

[list(Partition)]: list of Partition with 17 clusters.

c18

[list(Partition)]: list of Partition with 18 clusters.

c19

[list(Partition)]: list of Partition with 19 clusters.

c20

[list(Partition)]: list of Partition with 20 clusters.

c21

[list(Partition)]: list of Partition with 21 clusters.

c22

[list(Partition)]: list of Partition with 22 clusters.

c23

[list(Partition)]: list of Partition with 23 clusters.

c24

[list(Partition)]: list of Partition with 24 clusters.

c25

[list(Partition)]: list of Partition with 25 clusters.

c26

[list(Partition)]: list of Partition with 26 clusters.

Construction

Class ListPartition objects are mainly constructed by kml. Neverdeless, it is also possible to construct them from scratch using the fonction listPartition that does create an empty object.

Methods

object['xxx']

If 'xxx' is 'cX', 'initializationMethod', 'sorted' or 'criterionActif', get the value of the field xxx.

object['criterionValues',j]

Give the values of the criterion 'j' for all the Partitions. The result is return as a list. If 'j' is missing, the criterion actif is used.

object['criterionValuesAsMatrix',j]

Give the values of the criterion 'j' for all the Partitions. The result is return as a matrix. If 'j' is missing, the criterion actif is used.

object['xxx']

If 'xxx' is a criterion, this is equivalent to object['criterionValuesAsMatrix','xxx']

object['initializationMethod']<-value

Set the field to value

object['criterionActif']<-value

If 'value' is one of CRITERION_NAMES, it sets the field to the criterion 'value'.

object['add']<-value

If 'value' is an object of class 'Partition', then value is added to the Partition already hold in the field 'cX'. Note that a Partition with 'X' clusters is automatiquely added to the correct list 'cX' according to its number of clusters.

object['clear']<-'cX'

Clear the list 'cX'.

listPartition

Constructor. Build an empty object.

ordered

Order the Partition according to the criterion actif.

regroup

Order then merge identical Partition (usefull to reduce the size of the ListPartition)

Author

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

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

See Also

Classes: LongData
Methods: Partition

Examples

Run this code
##############
### Preparing data
data(artificialLongData)
traj <- as.matrix(artificialLongData[,-1])

### Some clustering
part2 <- partition(rep(c("A","B"),time=100),traj)
part3 <- partition(rep(c("A","B","C","A"),time=50),traj)
part3b <- partition(rep(c("A","B","C","B","C"),time=40),traj)
part4 <- partition(rep(c("A","B","A","C","D"),time=40),traj)


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

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

plotCriterion(listPart)
ordered(listPart)
plotCriterion(listPart)
regroup(listPart)
plotCriterion(listPart)
plotAllCriterion(listPart)

Run the code above in your browser using DataLab