Description Usage Arguments Details Examples
View source: R/lipidome_comparison_clustering.R
'hclust_dendrogram' takes a data frame and prints a dendrogram.
1 2 3 4 5 6 | hclust_dendrogram(
hclust_element,
labs = hclust_element$labels,
title = "Hierarchical clustering",
out_path = "none"
)
|
hclust_element |
object of class hclust. |
labs |
vector. Labels of dendrogram. Default: hclust_element$labels |
title |
string. Plot title. Default = "Hierarchical clustering". |
out_path |
string. Path to save plot to png. Default = to device. |
This function takes a data frame and transforms it into a matrix. The given matrix is then used to perform hiererchical clustering with the average, single or complete linkage. The clustering is plotted in a dendrogram.
1 2 3 4 5 6 7 8 | US_clust <- stats::hclust(stats::dist(USArrests, method = "euclidean"), method = "average")
hclust_dendrogram(US_clust)
hclust_dendrogram(US_clust, labs = 1:nrow(USArrests))
## Not run:
dir.create(paste(getwd(), "/examples", sep = ""), showWarnings = FALSE)
dir <- paste(getwd(), "/examples/USArrests", sep = "")
hclust_dendrogram(US_clust, out_path = dir)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.