mp_plot_dist-methods: Plotting the distance between the samples with heatmap or...

mp_plot_distR Documentation

Plotting the distance between the samples with heatmap or boxplot.

Description

Plotting the distance between the samples with heatmap or boxplot.

Usage

mp_plot_dist(
  .data,
  .distmethod,
  .group = NULL,
  group.test = FALSE,
  hclustmethod = "average",
  test = "wilcox.test",
  comparisons = NULL,
  step_increase = 0.1,
  ...
)

## S4 method for signature 'MPSE'
mp_plot_dist(
  .data,
  .distmethod,
  .group = NULL,
  group.test = FALSE,
  hclustmethod = "average",
  test = "wilcox.test",
  comparisons = NULL,
  step_increase = 0.1,
  ...
)

## S4 method for signature 'tbl_mpse'
mp_plot_dist(
  .data,
  .distmethod,
  .group = NULL,
  group.test = FALSE,
  hclustmethod = "average",
  test = "wilcox.test",
  comparisons = NULL,
  step_increase = 0.1,
  ...
)

## S4 method for signature 'grouped_df_mpse'
mp_plot_dist(
  .data,
  .distmethod,
  .group = NULL,
  group.test = FALSE,
  hclustmethod = "average",
  test = "wilcox.test",
  comparisons = NULL,
  step_increase = 0.1,
  ...
)

Arguments

.data

the MPSE or tbl_mpse object after [mp_cal_dist()] is performed with action="add"

.distmethod

the column names of distance of samples, it will generate after [mp_cal_dist()] is performed.

.group

the column names of group, default is NULL, when it is not provided the heatmap of distance between samples will be returned. If it is provided and group.test is TURE, the comparisons boxplot of distance between the group will be returned, but when group.test is FALSE, the heatmap of distance between samples with group information will be returned.

group.test

logical default is FALSE, see the .group argument.

hclustmethod

character the method of hclust, default is 'average' (= UPGMA).

test

the name of the statistical test, default is 'wilcox.test'

comparisons

A list of length-2 vectors. The entries in the vector are either the names of 2 values on the x-axis or the 2 integers that correspond to the index of the columns of interest, default is NULL, meaning it will be calculated automatically with the names in the .group.

step_increase

numeric vector with the increase in fraction of total height for every additional comparison to minimize overlap, default is 0.1.

...

additional parameters, see also geom_signif

Author(s)

Shuangbin Xu

See Also

[mp_cal_dist()] and [mp_extract_dist()]

Examples

## Not run: 
data(mouse.time.mpse)
mouse.time.mpse %<>% mp_decostand(.abundance=Abundance)
mouse.time.mpse
mouse.time.mpse %<>% 
  mp_cal_dist(.abundance=hellinger, distmethod="bray")
mouse.time.mpse
p1 <- mouse.time.mpse %>% 
        mp_plot_dist(.distmethod=bray)
p2 <- mouse.time.mpse %>% 
        mp_plot_dist(.distmethod=bray, .group=time, group.test=TRUE)
p3 <- mouse.time.mpse %>% 
        mp_plot_dist(.distmethod=bray, .group=time)

## End(Not run)

xiangpin/MicrobitaProcess documentation built on Nov. 6, 2024, 1:15 a.m.