expandParLongData: ~ Function: expandParLongData ~

expandParLongDataR Documentation

~ Function: expandParLongData ~

Description

Prepare the values of an object ParLongData to make them being usable by a plotting function.

Usage

expandParLongData(xParLongData, y)

Arguments

xParLongData

[ParLongData]: The object to expand.

y

[Partition] or [numeric]: see detail.

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 graphical functions plotTrajMeans and plotTrajMeans3d. This function modify theses values to make them fit with plotTrajMeans and plotTrajMeans3d 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 if pch='symbols'.

Value

An object of class ParLongData

Author

Christophe Genolini
1. UMR U1027, INSERM, Universit<e9> Paul Sabatier / Toulouse III / France
2. CeRSME, EA 2931, UFR STAPS, Universit<e9> de Paris Ouest-Nanterre-La D<e9>fense / Nanterre / France

References

[1] C. Genolini and B. Falissard
"KmL: k-means for longitudinal data"
Computational Statistics, vol 25(2), pp 317-328, 2010

[2] C. Genolini and B. Falissard
"KmL: A package to cluster longitudinal data"
Computer Methods and Programs in Biomedicine, 104, pp e112-121, 2011

Examples

###################
### 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)

longitudinalData documentation built on Feb. 16, 2023, 9:54 p.m.