#' Cuts dendrogram and returns names of proteins from specified cluster
#'
#' @param dendrogram dendrogram
#' @param k number of clusters
#' @param l if and which cluster to return
#' @param sort should cluster names be sorted
#'
#'
#' @return
#' @export
#'
#'
ct <- function(dendrogram, k = 2, l, sort = T) {
tree <- cutree(dendrogram, k = k)
if(sort) {
tree[] <- match(tree, unique(tree[dendrogram$order]))
}
if(hasArg(l)) {
names(tree)[tree == l]
}
else {
tree
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.