plot,LongData {longitudinalData}R Documentation

~ function: plot for LongData ~

Description

plot the LongData, either alone or relatively to a Partition. This function can plot the individual trajectories, the mean trajectories or both.

Usage

plot(x,y,...)
plotTraj(x,y,...)

Arguments

x [LongData]: Object containing the trajectories to plot.
y [Partition]: Gives the Partition used to color the 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 default, all are selected.
    type
    [character]: what type of plot should be drawn for the individual trajectories.
    type.mean
    [character]: what type of plot should be drawn for the mean trajectories.
    col
    [character], [numeric] or vector[numeric]: Specification of the ploting color of the individual trajectories. In addition to the standard possibles values, col="clusters" can be use to color the individual trajectories according to their clusters.
    col.mean
    [character], [numeric] or vector[numeric]: Specification of the ploting color of the mean trajectories. In addition to the standard possibles values, col="clusters" can be use to color each mean trajectories according to its clusters.
    lty
    [character]: the line type for the individual trajectories.
    lty.mean
    [character]: the line type for the mean trajectories.
    pch
    [character]: specify the symbol to be used as plotting point on the individual trajectories.
    pch.mean
    [character]: specify the symbol to be used as plotting point on the mean trajectories. Option pch.mean="symbols" or pch.mean="letters" can be used.
    pch.time
    [vector(numeric)]: precise the time at which a point should be plot (usefull if there is a important number of time, see example).
    cex.mean
    [numeric]: The magnification to be used for the symbol used as plotting point for the mean trajectories.
    legends
    [logical]: print the percent of individual in each groups.
    minSize
    [numeric]: minimum number of non missing value that an individual trajectories must contain to be drawn.

Details

plot the LongData, either alone or relatively 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, plotSubGroups(LongData)

Examples

#############
### Small example
traj1 <- gald()
part1 <- partition(rep(LETTERS[1:4],each=50),nbClusters=4)

### Several way to print the longData
par(ask=TRUE)
plot(traj1)
plot(traj1,part1)

### Only the longData, in black
plot(traj1,part1,type.mean="n", col=1)

### Only the clusters centers
plot(traj1,part1,type="n")

### only the clusters centers, in black with no letters
plot(traj1,part1,type="n",col.mean="black",type.mean="l")

### Big letter, in black (for publication...)
plot(traj1,part1,type="n",col.mean="black",cex.mean=2)

#############
### Big example
traj2 <- gald(time=0:500,functionClusters=list(
    function(t){5},
    function(t){-5},
    function(t){5*sin(t/25)}
))
part2 <- partition(rep(LETTERS[1:3],each=50),nbClusters=3)
plot(traj2,part2)

### Only the clusters mean
plot(traj2,part2,type="n")

### With not as much letters...
plot(traj2,part2,pch.time=25+0:9*50,cex=2,type="n")
par(ask=FALSE)

[Package longitudinalData version 0.6 Index]