Learn R Programming

kml3d (version 0.7)

exportClustering: ~ Function: exportClustering ~

Description

This function save the information of a Clustering object in 3 files and a graph.

Usage

## S3 method for class 'ClusterLongData,numeric':
exportClustering(object, y, nameObject,typeGraph = "bmp",
paramTraj=parTraj(),paramMean=parMean(),paramWindows=windowsCut(object["nbVar"]), ...)

Arguments

object
[ClusterizLongData]: object containing the LongData and the Clustering that have to be saved
y
[couple(numeric)]: indicate which Clustering shall be exported. The first numeric y[1] is the cluster number, the second y[2] is the rank of clustering in the list y[1].
nameObject
[character]: prefix use to name the files and the graph.
typeGraph
[character]: indicates the type of the graph that shall be exported. See savePlot for avalaible options.
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.
...
Parameters for the function bmp, jpeg, png or tiff.

Value

  • Three files and a graph.

code

choice

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

exportClustering export information about a Clustering in files. Four files/graphes are create:
  • name-Clusters.csv
{Table with two columns. The first is the identifier of each individual; the second holds the cluster's affectation of the individual.} name-Detail.csv{Information about the clusterization (qualities criterion, the percentage of individual in each cluster, detail about the algorithm used,...)} name-TrajMean.csv{Coordonates of the mean trajectories of each clusters.} name-Traj.ext{Graph (of type 'ext') representing the trajectories. All the parameters set during the visualization (color of the trajectories, symbols used, mean color, ...) are used here.}

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

Examples

Run this code
#############
### Creating a ClusterizLongData object, with 3 cluterings (5 clusters each)
myCld <- gald(c(15,15,15))
kml3d(myCld,5,3)

### Exporting the second clustering in pdf format
exportClustering(myCld,y=c(5,2),nameObject="myCld-5-2",typeGraph="bmp")

Run the code above in your browser using DataLab