| ClusterLongData3d-class {kml3d} | R Documentation |
~ Class: ClusterLongData3d ~
Description
ClusterLongData3d is an object containing joint-trajectories and
associated Partition.
Objects from the Class
kml3d is an algorithm that builds a set of Partition
from joint longitudinal data. ClusterLongData3d
is the object containing the original joint longitudinal data and all the Partition that kml3d finds.
When created, an ClusterLongData3d object simply contains initial
data (the joint-trajectories).
After the execution of kml3d, it contains
the original data and the Partition which has
just been find by kml3d.
Note that if kml3d is executed several times, every new Partition
are added to the original ones, no pre-existing Partition is erased.
Slots
idAll[vector(character)]: Single identifier for each of the joint-trajectory (each individual). Usefull for exporting clusters.idFewNA[vector(character)]: Restriction ofidAllto the trajectories that does not have 'too many' missing value. SeemaxNAfor details.time[numeric]: Time at which measures are made.varNames[vector(character)]: Names of the variable measured.traj[array(numeric)]: Contains the joint longitudianl data. Each horizontal plan (first dimension) corresponds to the trajectories of an individual. Vertical plans (second dimension) refer to the time at which measures are made. Transversal plans (the third dimension) are for variables.dimTraj[vector3(numeric)]: size of the arraytraj(iec(length(idFewNA),length(time),length(varNames))).maxNA[numeric]or[vector(numeric)]: Individual whose trajectories contain more missing value thanmaxNAare exclude fromtrajand will no be use in the analysis. Their identifier is preserved inidAllbut not inidFewNA. WhenmaxNAis a single number, it is used for all the variables.reverse[matrix(numeric)]: contain the mean (first line) and the standard deviation (second line) used to normalize the data. Usefull to restaure the original data after a scaling operation.criterionActif[character]: Store the criterion name that will be used by functions 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 thePartitioncurently hold in the object sorted in decreasing order ?c1[list(Partition)]: list of
Partitionwith 1 clusters.c2[list(Partition)]: list of
Partitionwith 2 clusters.c3[list(Partition)]: list of
Partitionwith 3 clusters....c26[list(Partition)]: list of
Partitionwith 26 clusters.
Extends
Class LongData3d, directly.
Class ListPartition, directly.
Methods
object['xxx']Get the value of the field
xxx. Inherit fromLongData3dandListPartition.object['xxx']<-valueSet the field
xxxtovalue.xxx. Inherit fromListPartition.plotDisplay the
ClusterLongData3d, one graph for each variable, according to aPartition.plot3dDisplay two variables of the
ClusterLongData3din 3D according to aPartition.plot3dPdfExport the AZY code for displaying two variables of the
ClusterLongData3din a 3D pdf graph.
Special thanks
Special thanks to Boris Hejblum for debugging the '[' and '[<-' operators (the previous version was not compatible with the matrix package, which is used by lme4).
Examples
### Move to tempdir
wd <- getwd()
setwd(tempdir()); getwd()
### Building longData
traj <- array(c(1,2,3,1,4, 3,6,1,8,10, 1,2,1,3,2, 4,2,5,6,3, 4,3,4,4,4, 7,6,5,5,4),
dim=c(3,5,2))
myCld <- clusterLongData3d(
traj=traj,
idAll=as.character(c(100,102,103)),
time=c(1,2,4,8,15),
varNames=c("P","A"),
maxNA=3
)
### Show
myCld
### Get
myCld['varNames']
### Set
myCld['criterionActif']<-"Davies.Bouldin"
### Plot
plot(myCld)
### Go back to current dir
setwd(wd)