Learn R Programming

kml3d (version 0.7)

plot,ClusterLongData: ~ function: plot for ClusterLongData ~

Description

plot the a ClusterLongData object.

Usage

## S3 method for class 'ClusterLongData,ANY':
plot(x,y,paramTraj=parTraj(),paramMean=parMean(),paramWindows=windowsCut(x['nbVar']),nbSample=200,toPlot=c("both"),nbCriterion=100)

Arguments

x
[ClusterLongData]: Object containing the trajectories to plot according to a Partition define by y.
y
[numeric]: Define Partition P that will be use to plot the object. P is a Partition hold in the field c2, c3, ... c26. If y=c(a,b), then
paramTraj
[parLongData]: Set the graphical parameters used to plot the trajectories of the LongData. See ParLongData for details.
paramMean
[parLongData]: Set the graphical parameters used to plot the mean trajectories of each clusters LongData (only when y is non missing). See ParLongData for detail
paramWindows
[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 numbre of trajectories (randomly chosen) that will be drawn.
toPlot
[character]: define the graph to plot. If "traj", then the trajectories are plot (like with function plot,LongData). If "criterion", then the criterion are plot (like with
nbCriterion
[numeric]: set the maximum number of criterion to display for a specific clusters number.

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

plot each variable of a ClusterLongData according to the Partition define by y.

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

See Also

ClusterLongData

Examples

Run this code
##################
### Real example on array

time=c(1,2,3,4,8,12,16,20)
id3=1:12000
f <- function(id,t)((id-1)%%3-1) * t
g <- function(id,t)(id%%2+1)*t
ld3 <- as.longData(array(cbind(outer(id3,time,f),outer(id3,time,g))+rnorm(12000*8*2,0,3),dim=c(12000,8,2)))
par(ask=TRUE)

### Basic plot
plot(ld3)

### Change the windows orientation
plot(ld3,paramWindows=windowsCut(c(2,1)))

### Change some parameters
plot(ld3,paramTraj=parTraj(col="red"))

### Plot only 1000 trajectories
plot(ld3,nbSample=1000)

### Plot all the trajectories
plot(ld3,nbSample=Inf)
par(ask=FALSE)

Run the code above in your browser using DataLab