
Last chance! 50% off unlimited learning
Sale ends in
partition
is the constructor of the class
Partition
. It can be build either alone or
relatively to a object LongData
.partition(clusters, traj, details=character())
[vector(factor)]
: cluters to which each
individual belongs. Each clusters is represented by an upper letters.[matrix]
or [array]
: if an object LongData
is
provide, it will be used to compute the quality criterion of the
clustering. array
are simply turn into matrix by "sticking"
all the variables[vector(character)]
: the slot details
is
used to store various informations. If the Partition
has been
find using an algorithm, it can store the name of the algorithm, the
time before convergence, the Partition
.partition
construct a object of class
Partition
. It does not provide any default
values. yLongData
and details
are optional.ordered
### Empty partition
partition()
### Small partition
partition(clusters=c("A","B","A","C","C"))
### Random partition
partition(clusters=LETTERS[floor(runif(100,1,5))])
### Partition that clusters correctly some data
### Quality criterion are high
data(artificialLongData)
traj <- as.matrix(artificialLongData[,-1])
partition(clusters=rep(1:4,each=50),traj)
### Partition that does not cluster correctly the data
### Quality criterion are low
partition(clusters=rep(1:4,50),traj)
Run the code above in your browser using DataLab