hclust_heatmap_interactive: Interactive hclust heatmap

Description Usage Arguments Details Examples

View source: R/lipidome_comparison_clustering.R

Description

'hclust_heatmap_interactive' takes a data frame and lets you open an interactive heatmap in the viewer or save the heatmap to png.

Usage

1
2
3
4
5
6
7
8
9
hclust_heatmap_interactive(
  input_df,
  row_names = rownames(input_df),
  col_names = colnames(dplyr::select_if(input_df, is.numeric)),
  dist_method = "euclidean",
  hclust_method = "complete",
  title = "Hierarchical clustering",
  out_path = "none"
)

Arguments

input_df

data frame.

row_names

data frame. Default are the row names of the input data frame.

col_names

data frame. Default are the column names of the input data frame.

dist_method

string. Method for the dist() function. dist_method = c("euclidean", "manhattan"). Default = "euclidean".

hclust_method

string. Method for the hclust() function. hclust_method = c("complete", "single", "average"). Default = "complete".

title

string. Plot title. Default = "Hierarchical clustering".

out_path

string. Path to save plot to png.

Details

This finction takes a data frame (optionally numeric or numeric with additional non-numeic varibles). Non-numeric variables are not part of the heatmap, but displayed in a separate box where the levels are color coded. The used method to create the heatmap is hierarchical clustering. Dendrograms are displayed for bowth rows and columns.

Examples

1
2
3
4
5
6
7
8
9
hclust_heatmap_interactive(iris, iris$Species)
hclust_heatmap_interactive(USArrests,
                           col_names = c("M", "A", "UP", "R"),
                           row_names = 1:50,
                           title = "Heatmap of USArrests")
## Not run: 
dir <- "examples/USArrests"
hclust_heatmap_interactive(USArrests, out_path = dir)
## End(Not run)

lisaschneider0509/lipidomeComparisonR documentation built on Aug. 12, 2020, 12:52 a.m.