Learn R Programming

kml3d (version 0.6)

expandParLongData: ~ Function: expandParLongData ~

Description

Change the values of an object ParLongData to make them fit with a Partition or with a number of clusters.

Usage

expandParLongData(xParLongData, y)

Arguments

xParLongData
[ParLongData]: The object to expand.
y
[Partition] or [numeric]: see detail.

Value

  • An object of class ParLongData

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

ParLongData object can hold values that are easy to specify (like col="clusters" or pch="symbol") but that can not be directly used by functions plot and plot3d. This function modify theses values to make them fit with plot and plot3d expectations. The field col and pch are the ones concern by this function. If y is a Partition, col and pch are extanded to fit with the number of individual. If y is a number of clusters, col and pch are extanded to fit with the number of clusters. If col='clusters', a color is affected to each clusters. Then the field col receive a vector of color such that each individual (if y is a Partition) or each clusters (if y is a number of clusters) get its corresponding color. If pch='letters', a letters is affected to each clusters. Then the field pch receive a vector of letters such that each individual (if y is a Partition) or each clusters (if y is a number of clusters) get its corresponding letters. Same think if pch='symbols'.

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
###################
### Some parameters for trajectories
(paramTraj <- parTraj(col="clusters"))

### Expand to a small partition with 3 clusters
part <- partition(LETTERS[rep(1:3,4)])
expandParLongData(paramTraj,part)


###################
### Some parameters for the mean trajectories
paramMean <- parMean()

### If there is 3 clusters :
expandParLongData(paramMean,3)

### If there is 5 clusters :
expandParLongData(paramMean,5)

Run the code above in your browser using DataLab