plot_cbass: Visualize the results of Convex BiClustering ('CBASS')

Description Usage Arguments Value Examples

Description

plot.CBASS provides a range of ways to visualize the results of convex clustering, including:

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## S3 method for class 'CBASS'
plot(
  x,
  ...,
  type = c("heatmap", "row.dendrogram", "col.dendrogram", "row.path", "col.path"),
  dynamic = FALSE,
  interactive = FALSE,
  percent,
  k.row,
  k.col,
  percent.seq = seq(0, 1, 0.01),
  axis = c("PC1", "PC2"),
  slider_y = -0.3,
  refit = FALSE
)

Arguments

x

An object of class CBASS as returned by CBASS

...

Additional arguments, which are handled differently for different values of type.

  • When type is "heatmap", "row.path" or "col.path", the presence of unknown arguments triggers an error;

  • when type == "row.dendrogram" or type == "col.dendrogram", ... is forwarded to dendrogram;

  • when type == "heatmap" and interactive == TRUE, ... is forwarded to heatmaply.

See the documentation of ggplot (for interactive == FALSE) or plotly (for interactive == TRUE) for details about additional supported arguments to the corresponding plot type.

type

A string indicating the type of visualization to show (see details above).

dynamic

A logical scalar.Should the resulting animation be dynamic (animated) or not? If TRUE, a dynamic visualization which varies along the CARP solution path at a grid given by percent.seq is produced. If FALSE, a fixed visualization at a single solution (determined by either percent or k if supplied) is produced.

interactive

A logical scalar. Should the resulting animation be interactive or not? If TRUE, an interactive visualization is produced by javascript(plotly). If FALSE, a non-interactive visualization is produced by ggplot.

percent

A number between 0 and 1, giving the regularization level (as a fraction of the final regularization level used) at which to assign clusters in the static (type = "dendrogram" or type = "path") plots.

k.row

An integer indicating the desired number of row clusters to be displayed in the static plots. (If plotting columns, the regularization level giving k.row rows clusters is used.)

k.col

An integer indicating the desired number of column clusters to be displayed in the static plots. (If plotting rows, the regularization level giving k.col column clusters is used.)

percent.seq

A grid of values of percent along which to generate dynamic visualizations (if dynamic == TRUE)

axis

A character vector of length two indicating which features or principal components to use as the axes in the path visualizations. Currently only features like "PC1" or "PC2" (indicating the first principal component projections) are supported.

slider_y

A number to adjust the slider's vertical position for interactive dendrogram plots (ignored for other plot types).

refit

A logical scalar. Should "naive" centroids (TRUE) or the actual centroids estimated by convex clustering be used? When the default refit = FALSE, the estimated U from the convex clustering problem is used. The refit = TRUE returns actual centroids (mean) of all elements assigned to that cluster; Due to the global shrinkage imposed, these clusters are more "shrunk together" than the naive clusters. Only for the heatmap plots. (ignored for other plot types).

Value

The value of the return type depends on the interactive and dynamic:

All the plots can be plotted directly (by invoking its print method) or further manipulated by the user.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
cbass_fit <- CBASS(presidential_speech)
plot(cbass_fit)
plot(cbass_fit, type = "col.path")
plot(cbass_fit, type = "col.dendrogram")
plot(cbass_fit, type = "heatmap")
plot(cbass_fit, type = "heatmap", dynamic = TRUE)
## Not run: 
plot(cbass_fit, type='heatmap', interactive=TRUE)

## End(Not run)

jjn13/clustRviz documentation built on Sept. 1, 2020, 7:53 a.m.