Transfer dist to b_dist

Plot dist

Plot b_dist

as.b_dist(dist, group_df = NULL)

# S3 method for dist
plot(x, group_df = NULL, ...)

# S3 method for b_dist
plot(x, mode = 1, c_group = "inter", ...)

Arguments

dist

a dist object

group_df

a dataframe with rowname same to dist and one group column

x

a b_dist

...

additional

mode

1~3

c_group

"inter" or "intra" or both to plot

Value

a b_dist with annotation by group

a pheatmap

a ggplot or pheatmap

Examples

data(otutab, package = "pcutils")
mat_dist(otutab) %>% as.b_dist(., group_df = metadata["Group"]) -> aa
plot(aa)

plot(aa, mode = 2)