mp_cal_clust-methods: Hierarchical cluster analysis for the samples with MPSE or...

mp_cal_clustR Documentation

Hierarchical cluster analysis for the samples with MPSE or tbl_mpse object

Description

Hierarchical cluster analysis for the samples with MPSE or tbl_mpse object

Usage

mp_cal_clust(
  .data,
  .abundance,
  distmethod = "bray",
  hclustmethod = "average",
  action = "get",
  ...
)

## S4 method for signature 'MPSE'
mp_cal_clust(
  .data,
  .abundance,
  distmethod = "bray",
  hclustmethod = "average",
  action = "get",
  ...
)

## S4 method for signature 'tbl_mpse'
mp_cal_clust(
  .data,
  .abundance,
  distmethod = "bray",
  hclustmethod = "average",
  action = "get",
  ...
)

## S4 method for signature 'grouped_df_mpse'
mp_cal_clust(
  .data,
  .abundance,
  distmethod = "bray",
  hclustmethod = "average",
  action = "get",
  ...
)

Arguments

.data

the MPSE or tbl_mpse object

.abundance

the name of abundance to be calculated.

distmethod

the method of distance.

hclustmethod

the method of hierarchical cluster

action

a character "add" will return a MPSE object with the cluster result as a attributes, and it can be extracted with 'object "only" or "get" will return 'treedata' object, default is 'get'.

...

additional parameters

Value

update object with the action argument, the treedata object contained hierarchical cluster analysis of sample, it can be visualized with 'ggtree' directly.

Author(s)

Shuangbin Xu

Examples

library(ggtree)
library(ggplot2)
data(mouse.time.mpse)
res <- mouse.time.mpse %>%
 mp_decostand(.abundance=Abundance) %>% 
 mp_cal_clust(.abundance=hellinger, distmethod="bray")
res
res %>%
 ggtree() + 
 geom_tippoint(aes(color=time))

xiangpin/MicrobiotaProcess documentation built on July 24, 2024, 11:44 p.m.