Learn R Programming

kml (version 2.1.2)

plot,ClusterLongData: ~ Function: plot for ClusterLongData ~

Description

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

Usage

## S3 method for class 'ClusterLongData,ANY':
plot(x,y,parTraj=parTRAJ(),parMean=parMEAN(),parWin=windowsCut(x['nbVar'],addLegend=TRUE),nbSample=1000,toPlot=c("both"),criterion=x["criterionActif"],nbCriterion=100,standardized = FALSE,...)

Arguments

x
[ClusterLongData]: Object containing the trajectories to plot.
y
[numeric] or [vector(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
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="clu
parMean
[ParLongData]: Specification of the plotting parameters of the mean trajectories. Fields that can be changes are 'type','col','pch','pchPeriod' and 'cex'. 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.
toPlot
[character]: either 'traj' for plotting trajectories alone, 'criterion' for plotting criterion alone, 'both' for plotting both or 'none' for not display anything (faster).
criterion
[character] or [vector(character)]: criterion to display (only if 'toPlot' is 'criterion' or 'both'). If a single criterion is given, it will be display for all the Partition. If several criterion are
nbCriterion
[numeric]: if a single criterion is given to criterion (and thus is displayed for 'all' the Partition), this slot alows to fix a limit on the number of points that will be display.
standardized
[logical]: if several criterion are display on the same graph, should they be mapped into [0:1] (in order to be on the same scale and therefor being comparable) ?
...
Some other parameters can be passed to the method.

Details

plot the trajectories of an object ClusterLongData relativly to the 'best' Partition, or to the Partition define by y. Graphical option concerning the individual trajectory (col, type, pch and xlab) can be change using parTraj. Graphical option concerning the cluster mean trajectory (col, type, pch, pchPeriod and cex) can be change using parMean. For more detail on parTraj and parMean, see object of class ParLongData.

See Also

Overview: kml-package Classes : ClusterLongData Plot : plot: overview, plotCriterion

Examples

Run this code
##################
### Construction of the data

ld <- gald()
part <- partition(rep(1:4,each=50))

### Basic plotting
plot(ld)
plot(ld,part)


##################
### Changing graphical parameters 'par'

### No letters on the mean trajectories
plot(ld,part,parMean=parMEAN(type="l"))

### Only one letter on the mean trajectories
plot(ld,part,parMean=parMEAN(pchPeriod=Inf))

### Color individual according to its clusters (col="clusters")
plot(ld,part,parTraj=parTRAJ(col="clusters"))

### Mean without individual
plot(ld,part,parTraj=parTRAJ(type="n"))


### No mean trajectories (type="n")
### Color individual according to its clusters (col="clusters")
plot(ld,part,parTraj=parTRAJ(col="clusters"),parMean=parMEAN(type="n"))

### Only few trajectories
plot(ld,part,nbSample=10,parTraj=parTRAJ(col='clusters'),parMean=parMEAN(type="n"))

Run the code above in your browser using DataLab