if (!require("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("yeastCC")
if (!require("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("yeastCC")
x <- matrix(rnorm(100), nrow = 5) dim(x)
[1] 5 20
heatmap(x)
Remove dendogram
heatmap(x, Colv = NA)
Returns pairwise distance matrix between rows of a data matrix
dist(x)
1 2 3 4 2 5.728357 3 7.435952 7.348611 4 6.681600 6.464734 8.268792 5 5.337119 6.253327 7.095763 5.704023
Clusters using a distance matrix
hclust(dist(x))
Call: hclust(d = dist(x)) Cluster method : complete Distance : euclidean Number of objects: 5
Clusters using a distance matrix
plot(hclust(dist(x)))
heatmap(x, Colv = NA)
Cuts a tree, e.g., as resulting from hclust, into the desired number(s) of groups
cutree(tree, no. of clusters)
tree <- hclust(dist(x)) cutree(tree,2)
[1] 1 1 2 1 1
tree <- hclust(dist(x)) cutree(tree,5)
[1] 1 2 3 4 5