ClusterLongData3d-class: ~ Class: ClusterLongData3d ~

ClusterLongData3d-classR 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 of idAll to the trajectories that does not have 'too many' missing value. See maxNA for 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 array traj (ie c(length(idFewNA),length(time),length(varNames))).

maxNA

[numeric] or [vector(numeric)]: Individual whose trajectories contain more missing value than maxNA are exclude from traj and will no be use in the analysis. Their identifier is preserved in idAll but not in idFewNA. When maxNA is 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 the Partition curently hold in the object sorted in decreasing 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.

...
c26

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

Extends

Class LongData3d, directly. Class ListPartition, directly.

Methods

object['xxx']

Get the value of the field xxx. Inherit from LongData3d and ListPartition.

object['xxx']<-value

Set the field xxx to value. xxx. Inherit from ListPartition.

plot

Display the ClusterLongData3d, one graph for each variable, according to a Partition.

plot3d

Display two variables of the ClusterLongData3d in 3D according to a Partition.

plot3dPdf

Export the AZY code for displaying two variables of the ClusterLongData3d in 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)

kml3d documentation built on Feb. 16, 2023, 9:44 p.m.