cluster_jsd | R Documentation |
'cluster_jsd' cluster the sample using the pam based the JSD.
cluster_jsd(dist, b, k)
dist |
distance matrix, if miss distance matrix the bacterial abundance matrix 'b' was used to calculate the Jensen-Shannon divergence |
b |
bacterial abundance matrix, if the distance matrix 'dist' was given, it is useless |
k |
number of cluster |
cluster vector
data(iris)
## using the matrix to cluster samples.
b <- bSet(b = data.table::as.data.table(t(iris[1:6, 1:4])),
Features = letters[1:4],
Samples = LETTERS[1:6])
res_cluster <- cluster_jsd(b=b, k = 3)
## or using the resoult of dist_jsd
## dist <- dist_jsd(iris[, 1:4])
## res_cluster <- cluster_jsd(dist = iris[,1:4], k = 3)
table(res_cluster, iris[1:6, 5])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.