clusters: Cluster bar plot

Description Usage Arguments Value Author(s) Examples

View source: R/clusters.R

Description

This function plots clusters over a set of trajectories as joint, coloured bar plots. The clusters are sorted beginning with the most populated one in descending order.

Usage

1
2
3
4
5
clusters( clusters,
          clustersNumber = NA,
          legendTitle = "trajectories",
          barePlot = FALSE,
          ... )

Arguments

clusters

Matrix with clusters: trajectories are given in row-wise, clusters in column-wise fashion as provided by load_clusters(), the associated loading function.

clustersNumber

When specified, only these first clusters are shown.

legendTitle

The title of the legend.

barePlot

Boolean, indicating whether the plot is to be made without any additional information.

...

Additional arguments (ellipsis).

Value

Returns a nxm-matrix with n being the number of input trajectories and m the number of different clusters. Each element in the matrix holds the number of snapshots, the respective cluster occurred in the respective trajectory.

Author(s)

Christian Margreitter

Examples

1
2
3
# GROMOS (see load_clusters() for other input possibilities)
clusters( load_clusters( system.file( "extdata/clusters_example.txt.gz",
                                      package = "MDplot" ) ) )

Example output

Loading required package: MASS
Loading required package: RColorBrewer
Loading required package: gplots

Attaching package: 'gplots'

The following object is masked from 'package:stats':

    lowess

Loading required package: gtools
  cluster1 cluster2 cluster3 cluster4 cluster5 cluster6 cluster7 cluster8
1     8539        0      175        0        0      284        0        0
2     3027     5224        0      178       62        3      370        1
3     8926        0        0        0        0       71        0        0
4     7999        0      928        0        0       37        0        0
5     2993     5064       12      390      368        7        0      106
6     8837        0      122        0        0       26        0        0
  cluster9 cluster10 cluster11 cluster12 cluster13 cluster14 cluster15
1        0         0         0         0         0         0         0
2       65         3        10        23        10        12         0
3        0         0         2         0         0         0         0
4        0        35         0         0         0         0         0
5        9         0        19         0        11         3        11
6        0         8         6         0         0         0         0
  cluster16 cluster17 cluster18 cluster19 cluster20 cluster21 cluster22
1         0         0         0         2         0         0         0
2         4         4         0         0         3         0         1
3         0         0         0         1         0         0         0
4         0         0         0         0         0         0         0
5         0         0         4         0         0         2         0
6         0         0         0         0         0         0         0
  cluster23 cluster24 cluster25
1         0         0         0
2         0         0         0
3         0         0         0
4         1         0         0
5         0         1         0
6         0         0         1

MDplot documentation built on May 2, 2019, 7:02 a.m.

Related to clusters in MDplot...