plotTraj
plot the trajectories of an object ClusterLongData
relativly
to a Partition
.
# S4 method for ClusterLongData,ANY
plotTraj(x,y,parTraj=parTRAJ(col="clusters"),
parWin=windowsCut(x['nbVar'],addLegend=TRUE),nbSample=1000,...)
[ClusterLongData]
: Object containing the trajectories to plotTraj.
[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).
[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.
[parWindows]
: Set the graphical display of
the windows. See ParWindows
for details.
[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.
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
.
Overview: kml-package
Classes : ClusterLongData
PlotTraj : plotTraj: overview
, plotCriterion
### Move to tempdir
wd <- getwd()
setwd(tempdir()); getwd()
##################
### Construction of the data
ld <- gald()
kml(ld,3:4,1)
### Basic plotTrajting
plotTraj(ld,3)
### Go back to current dir
setwd(wd)
Run the code above in your browser using DataLab