Learn R Programming

kml3d (version 2.3)

clusterLongData3d: ~ Function: clusterLongData3d (or cld3d) ~

Description

clusterLongData3d (or cld3d in short) is the constructor for ClusterLongData3d object.

Usage

clusterLongData3d(traj, idAll, time, timeInData, varNames, maxNA)
cld3d(traj, idAll, time, timeInData, varNames, maxNA)

Arguments

traj
[array(numeric)] or [data.frame]: structure containning the joint-trajectories. Each line (traj[i,,]) is a joint-trajectory of an individual ; columns (traj[,j,]) refer to the time during
idAll
[vector(character)]: single identifier for each trajectory (ie each individual). Note that the identifiers are of type character (that allow to deal identifiers like XUK32-612, identifiers that our fav
time
[vector(numeric)]: time at which measures were made.
timeInData
[list(vector(numeric))]: precise the column containing the trajectories. The list labels are the names of the variables (like list(A=c(2,3,4),B=c(5,7,9))).
varNames
[character]: name of the variable being measured.
maxNA
[numeric] or [vector(numeric)] : maximum number of NA that are tolerates on a trajectory. If a trajectory has more missing than maxNA, then it is remove from the analysis. Note the maxNA c

Value

  • An object of class ClusterLongData3d.

Details

clusterLongData3d construct a object of class ClusterLongData. Two cases can be distinguised: [object Object],[object Object]

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
clusterLongData3d(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
clusterLongData3d(traj=tr1n,
    idAll=as.character(c(100,102,104)),
    time=c(1,2,4,8,16),
    varNames=c("P","A"),
    maxNA=2
)

Run the code above in your browser using DataLab