cluster_jsd: cluster_jsd

View source: R/enterotype.R

cluster_jsdR Documentation

cluster_jsd

Description

'cluster_jsd' cluster the sample using the pam based the JSD.

Usage

cluster_jsd(dist, b, k)

Arguments

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

Value

cluster vector

Examples


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])


gongcongcong/mbOmic documentation built on July 1, 2023, 1:47 p.m.