Learn R Programming

kml3d (version 0.6)

clusterLongData: ~ Function: clusterLongData (or cld) ~

Description

clusterLongData (or cld in short) is the constructor of the class ClusterLongData.

Usage

clusterLongData(traj, idAll, time, varNames, maxNA = length(time) - 2,criterionActif="calinski")
cld(traj, idAll, time, varNames, maxNA = length(time) - 2,criterionActif="calinski")

Arguments

traj
[array(numeric)]: structure containning the trajectories.
idAll
[vector(character)]: single identifier for each trajectory (ie each individual).
time
[vector(numeric)]: time at which measures are made.
varNames
[character]: names of the variable being measured.
maxNA
[numeric] or [vector(numeric)]: Fixes the number of maximum missing values that can be tolerate in a trajectory; Should this number be exceed maxNA, the trajectory would be removed from traj
criterionActif
[character] Set the criterion that will be use by fonctions that need a single criterion (like plot or ordered).

Value

  • An object of class ClusterLongData.

Author(s)

Christophe Genolini INSERM U669 / PSIGIAM: Paris Sud Innovation Group in Adolescent Mental Health Modal'X / Universite Paris Ouest-Nanterre- La Defense Contact author : genolini@u-paris10.fr

Details

clusterLongData construct a object of class ClusterLongData. It does not provide any default values except for maxNA which is length(time)-2. It is not realy friendly user function; use as.clusterLongData instead.

References

Article "KmL: K-means for Longitudinal Data", in Computational Statistics, Volume 25, Issue 2 (2010), Page 317. Web site: http://christophe.genolini.free.fr/kml

Examples

Run this code
###############
### Building an array
tr1n <- array(c(1,2,NA, 1,4,NA, 6,1,8, 10,NA,2, 3,NA,NA,
                4,NA,5,  6,3,4, 3,4,4, 4,NA,NA, 5,5,4),
            dim=c(3,5,2))


###############
### clusterLongData

### With maxNA=3
longData(traj=tr1n,
    idAll=as.character(c(100,102,104)),
    time=c(1,2,4,8,16),
    varNames=c("P","A"),
    maxNA=3
)

### With maxNA=2
### Individual 104 is exclude
longData(traj=tr1n,
    idAll=as.character(c(100,102,104)),
    time=c(1,2,4,8,16),
    varNames=c("P","A"),
    maxNA=3
)

Run the code above in your browser using DataLab