Learn R Programming

longitudinalData (version 0.6.4)

plotSubGroups: ~ Function: plotSubGroups for LongData ~

Description

Plot the trajectories of all the subgroups on several graph (one on each graph) of an object LongData relativly to a Partition. This function can plot the individual trajectories, the mean trajectories or both.

Usage

plotSubGroups(x, y, ...)

Arguments

x
[LongData]: Object containing the trajectories to plot.
y
[Partition]: Give the Partition used to color the individual trajectories. If y is missing, a Partition with a single cluster is considered.
...
Graphical parameters to be passed to methods (see plot). For LongData object specificly :
  • subGroups
{[vector(character)]: which subGroups of the Partition should be ploted ? By

Author(s)

Christophe Genolini PSIGIAM: Paris Sud Innovation Group in Adolescent Mental Health INSERM U669 / Maison de Solenn / Paris Contact author :

Details

Plot the trajectories of all the subgroups on several graph (one on each graph) of an object LongData relativly to a Partition. This function can plot the individual trajectories, the mean trajectories or both. Some graphical parameters are available twice, once for the individual trajectories (like type or col), once for the mean trajectories (like type.mean or col.mean).

See Also

LongData,plot(LongData)

Examples

Run this code
#############
### Building data
ld <- gald()
par(ask=TRUE)

### Default ploting
plotSubGroups(ld)

### Only the trajectories in black
plotSubGroups(ld,col=1,type.mean="n")

### Plot according to a partition
###   (regular plot, then plotSubGroups
part <- partition(clusters=rep(LETTERS[1:4],each=50),nbClusters=4)
plot(ld,part,type.mean="n")
plotSubGroups(ld,part,type.mean="n")

### Only the mean trajectories, with letters (for publication ?)
plotSubGroups(ld,part,type="n",col.mean=1,size=2)

### All at once.
plotSubGroups(ld,part)

par(ask=FALSE)

Run the code above in your browser using DataLab