Learn R Programming

kml (version 2.1.2)

ClusterizLongData-class: ~ Class: ClusterizLongData ~

Description

ClusterizLongData is an objet containing trajectories and associated clusterizations.

Arguments

Objects from the Class

kml is an algorithm that builds an set of Clusterization from longitudinal data. ClusterizLongData is the object contaning the original longitudinal data and all the Clusterization that kml finds. When created, an ClusterizLongData object simply contains initial data (the trajectories). After the execution of kml, it contains the original data and the Clusterization which has just been calculated by kml. Please note that if kml is executed several times, every new Clusterization are added to the original ones, no pre-existing Clusterization is erased.

Construction

Class ClusterizLongData objects can be constructed via function cld (build from scratch) and via as.cld (turning a data.frame or a LongData into a ClusterizLongData). Note that some artificial data can be generated using the combinaison of as.cld and generateArtificialLongData.

Author(s)

Christophe Genolini PSIGIAM: Paris Sud Innovation Group in Adolescent Mental Health INSERM U669 / Maison de Solenn / Paris Contact author :

English translation

Rapha�l Ricaud Laboratoire "Sport & Culture" / "Sports & Culture" Laboratory University of Paris 10 / Nanterre

References

Article submited Web site: http://christophe.genolini.free.fr/kml

See Also

Overview: kml-package Classes : Clusterization, LongData Methods : clusterizLongData, kml, choice, as.clusterizLongData Plot : plot:overview, plot(ClusterizLongData), plotCriterion, plotSubGroups(ClusterizLongData), plotAll(ClusterizLongData)

Examples

Run this code
################
### Creation of some trajectories
mat <- matrix(c(1,2,3,1,NA,6,1,8,NA),3)

################
### Creation of LongitudinalData
clustLd <- new("ClusterizLongData",id=c("1","2","3"),time=c(2,4,8),varName="Age",traj=mat,trajMinSize=2)

################
### get and set
clustLd["id"]
clustLd["time"]<- c(1,3,9)
clustLd["varName"]
clustLd["traj"]
clustLd["traj"][3,]<-c(2,7,9)

################
### Creation of a clusterization
part <- partition(nbClusters=2,clusters=LETTERS[c(1,2,1)])
clus <- clusterization(xPartition=part,yLongData=clustLd)

################
### Adding a clusterization to a clusterizLongData
(clustLd["clusters","add"] <- clus)

################
### Removing all the clusterization from a clusterizLongData
clustLd["clusters","clear"] <- "all"
(clustLd)

Run the code above in your browser using DataLab