Learn R Programming

kml (version 2.4.6.1)

choice: ~ Function: choice ~

Description

choice lets the user choose some Partition he wants to export.

Usage

choice(object, typeGraph = "bmp")

Value

For each selected Partition, four files are saved, plus two global files.

Arguments

object

[ClusterLongData]: Object containing the trajectories and all the Partition found by kml.

typeGraph

[character] for every selected Partition, choice export some graphs. typeGraph set the format that will be used. Possible formats are the ones available for savePlot.

Details

choice is a function that lets the user see the Partition found by kml. At first, choice opens a graphics window (for Linux user, the windows should be explicitly open using x11(type = "Xlib")). On the left side, all the Partition contain in Object are ploted by a number (the number of cluster of the Partition). The level of the number is proportionnal to a quality criteria (like Calinski & Harabatz). One Partition is 'active', it is the one marked by a black dot.

On the right side, the trajectories of Object are drawn, according to the active Partition.

From there, choice offers numerous options :

Arrow

Change the active Partition.

Space

Select/unselect a Partition (the selected Partition are surrounded by a circle).

Return

Export all the selected Partition, then quit the function choice.

'e'

Change the display (Trajectories alone / quality criterion alone / both)

'd'

Change actif criterion.

'c'

Sort the Partition according to the actif criterion.

'r'

Change the trajectories' style.

'f'

Change the means trajectories's style.

'g/t'

Change the symbol size.

'y/h'

Change the number of symbols.

When 'return' is pressed (or 'm' using Linux), the selected Partition are exported. Exporting is done in a specific named objectName-Cx-y where x is the number of cluster and y is the order in the sublist. Four files are created :

objectName-Cx-y-Clusters.csv

Table with two columns. The first is the identifier of each trajectory (idAll); the second holds the cluster's affectation of the trajectory.

objectName-Cx-y-Detail.csv

Table containing information about the clusteration (percentage of individual in each cluster, various qualities criterion, algorithm used to find the partition and convergence time.)

objectName-Cx-y-Traj.bmp

Graph representing the trajectories. All the parameters set during the visualization (color of the trajectories, symbols used, mean color) are used for the export. Note that the 'typeGraph' argument can be used to export the graph in a format different than 'bmp'.

objectName-Cx-y-TrajMean.bmp

Graph representing the means trajectories of each clusterss. All the parameters set during the visualization (color of the trajectories, symbols used, mean color) are used for the export.

This four file are created for each selected Partition. In addition, two 'global' graphes are created :

objectName-criterionActif.bmp

Graph presenting the values of the criterionActifall for all the Partition.

objectName-criterionAll.bmp

For each cluster's number, the first Partition is considered. This graph presents on a single display the values of all the criterion for each first Partition. It is helpfull to compare the various qualities criterion.

See Also

Overview: kml-package
Classes : ClusterLongData, Partition
Methods : kml
Plot : plot

Examples

Run this code
### Move to tempdir
wd <- getwd()
setwd(tempdir()); getwd()

### Creation of artificial data
cld1 <- gald(25)

### Clusterisation
kml(cld1,3:5,nbRedrawing=2,toPlot='both')

### Selection of the clustering we want
#     (note that "try" is for compatibility with CRAN only,
#     you probably can use "choice(cld1)")
try(choice(cld1))

### Go back to current dir
setwd(wd)

Run the code above in your browser using DataLab