Partition
is a partition of a population
into subgroups. The object also contains some information like the
percentage of trajectories in each group or some qualities criterion.
nbClusters
clusters
percentEachCluster
postProba
postProbaEachCluster
criterionValues
Clustering
. See qualityCriterion
for details.details
details=c(algorithm="kmeans",convergenceTime="3")
.Partition
object must follow some rules to be valid:
nbClusters
has to be lower or equal to 26.
clusters
is a factor in LETTERS[1:nbCluster]
.
Partition
objects are mainly constructed by some clustering methods
(like k-means, fuzzy k-means, mixture modeling, latent class
analysis,...). Neverdeless, it is also possible to construct them from
scratch using the fonction partition
.nbClusters
)clusters
)[vector(integer)]
: Gets the
cluster of each individual and turn them into integer[vector(numeric)]
: Get the
percent of individual
in each clusters (the value of the slot nbClusters
)[vector(numeric)]
: Get the
post probabilities for each clusters.[matrix(numeric)]
: Get the
post probabilities for each individual and each clusters.[vector(numeric)]
: gives the values
of all the
criterion values (the value of the slot criterionValues
)[vector(character)]
: Get the values
of the slot details
.[numeric]
: Get the value of the criterion
XcriterionX
. It can be one of Calinski.Harabatz
,
Krzysztof.Calinski
, Genolini.Calinski
, Ray.Turi
,
Davies.Bouldin
, BIC
, AIC
, AICc
or random
.[character]
: Get the value named
XspecialX
in
the slot details
(probably one of multiplicity
,
convergenceTime
, imputationMethod
or
algorithm
.)details
, sets the values names multiplicity
to value
.details
, sets the values names convergenceTime
to value
.[2] C. Genolini and B. Falissard "KmL: A package to cluster longitudinal data" Computer Methods and Programs in Biomedicine, 104, pp e112-121, 2011
longitudinalData-package
Classes: LongData
Methods: partition
############
### Building Partition
### number
part <- partition(rep(c(1,2,1,3),time=3))
### LETTERS
part <- partition(rep(c("A","B","D"),time=4),details=c(convergenceTime="3",multiplicity="1"))
### Others don't work
try(partition(rep(c("A","Bb","C"),time=3)))
#############
### Setteur and Getteur
### '['
part["clusters"]
part["clustersAsInteger"]
part["nbClusters"]
### '[<-'
part["multiplicity"] <- 2
(part)
Run the code above in your browser using DataLab