make.tree | R Documentation |
This estimates a dendrogram of feautres based on correlation coefficeint of your choice, and a clustering method of choice
make.tree(wdata, cor_method = "spearman", hclust_method = "complete")
wdata |
the metabolite data matrix. samples in row, metabolites in columns |
cor_method |
the correlation method used in the function cor(). Default is "spearman". |
hclust_method |
the dendrogram clustering method used in the construction of the tree. Default is "complete". |
an hclust object
cmat = matrix(1, 4, 4 ) cmat[1,] = c(1, 0.8, 0.6, 0.2) cmat[2,] = c(0.8, 1, 0.7, 0.5) cmat[3,] = c(0.6, 0.7, 1, 0.6) cmat[4,] = c(0.2, 0.5, 0.6,1) ## simulate some correlated data (multivariable random normal) set.seed(1110) ex_data = MASS::mvrnorm(n = 250, mu = c(5, 45, 25, 15), Sigma = cmat ) ## estiamte the dendrogram tree = make.tree(ex_data) ## plot the dendrogram plot(tree, hang = -1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.