Learn R Programming

specmine (version 3.1.6)

dendrogram_plot_col: Plot dendrogram

Description

Plot dendrogram of hierarchical clustering results with different colors

Usage

dendrogram_plot_col(dataset, hc.result, classes.col, colors = NULL, title = "", 
lab.cex = 1, leg.pos = "topright", label_samples=NULL,...)

Arguments

dataset

list representing the dataset from a metabolomics experiment.

hc.result

object of class hclust with the clustering results.

classes.col

string or index indicating what metadata to use to color the leafs.

colors

vector with the corresponding colors of the metadata classes.

title

title of dendrogram.

lab.cex

the magnification to be used for x and y labels relative to the current setting of cex.

leg.pos

position of the legend.

label_samples

string or index indicating what metadata to use to name the leafs. If not provided the name of the leafs will remain the samples names.

other parameters for plotting.

Examples

Run this code
# NOT RUN {
  ## Example of colored dendrogram
  library(specmine.datasets)
  data(cachexia)
  hc.result = hierarchical_clustering(cachexia)
  dendrogram_plot_col(cachexia, hc.result, "Muscle.loss", 
  title = "Example")
# }

Run the code above in your browser using DataLab