Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

plotTraj

~ Function: plotTraj for ClusterLongData ~


Description

plotTraj plot the trajectories of an object ClusterLongData relativly to a Partition.

Usage

## S4 method for signature 'ClusterLongData,ANY'
plotTraj(x,y,parTraj=parTRAJ(col="clusters"),
   parWin=windowsCut(x['nbVar'],addLegend=TRUE),nbSample=1000,...)

Arguments

x

[ClusterLongData]: Object containing the trajectories to plotTraj.

y

[numeric] or [couple(numeric)]: Give the Partition to represent. If y is missing, the Partition with the highest quality criterion (the actif one) is selected. If y is a number, the first Partition of the sublist c-y is selected. If y is a couple of numeric, the y[2]th Partition of the sublist c-y[1] is selected (so y=c(2,3) select the partition with 2 clusters, the third one).

parTraj

[ParLongData]: Specification of the plotting parameters of the individual trajectories. Fields that can be changes are 'type','col','pch','xlab' and 'ylab'. In addition to the standard possible values, the option col="clusters" (the default) can be use to color the individual trajectories according to their clusters (exemple: parTraj=parTRAJ(type="o",col="clusters")). See ParLongData for details.

parWin

[parWindows]: Set the graphical display of the windows. See ParWindows for details.

nbSample

[numeric]: Graphical display of huge sample can be time consumming. This parameters fixe the maximum number of trajectories (randomly chosen) that will be drawn.

...

Some other parameters can be passed to the method.

Details

plotTraj the trajectories of an object ClusterLongData relativly to the 'best' Partition, or to the Partition define by y.

Graphical option (col, type, pch and xlab) can be change using parTraj. For more detail on parTraj, see object of class ParLongData.

See Also

Examples

##################
### Construction of the data

ld <- gald()
kml(ld,3:4,1)

### Basic plotTrajting
plotTraj(ld,3)

kml

K-Means for Longitudinal Data

v2.4.1
GPL (>= 2)
Authors
Christophe Genolini [cre, aut], Bruno Falissard [ctb]
Initial release
2016-02-02

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.