DistBoxplot: DistBoxplot

View source: R/DistBoxplot.R

DistBoxplotR Documentation

DistBoxplot

Description

DistBoxplot

Usage

DistBoxplot(
  dm,
  group,
  dm_name = "Dist",
  group_name = "",
  IndividualID = NULL,
  outdir = ""
)

Arguments

dm

A squared distance matrix or a 'dist' object.

group

A factor indicates a metadata variable corresponds to samples in the distance matrix.

dm_name

An optional character string for the distance name.

group_name

An optional character string for the metadata variable name.

IndividualID

Another metadata variable that can make this function return only paired distance values within this group.

outdir

The output directory.

Author(s)

Shi Huang

Examples

set.seed(123)
x <- data.frame(rbind(t(rmultinom(7, 75, c(.201,.5,.02,.18,.099))),
            t(rmultinom(8, 75, c(.201,.4,.12,.18,.099))),
            t(rmultinom(15, 75, c(.011,.3,.22,.18,.289))),
            t(rmultinom(15, 75, c(.091,.2,.32,.18,.209))),
            t(rmultinom(15, 75, c(.001,.1,.42,.18,.299)))))
x0 <- data.frame(rbind(t(rmultinom(7, 75, c(.011,.3,.22,.18,.289))),
            t(rmultinom(8, 75, c(.011,.3,.22,.18,.289))),
            t(rmultinom(15, 75, c(.011,.3,.22,.18,.289))),
            t(rmultinom(15, 75, c(.011,.3,.22,.18,.289))),
            t(rmultinom(15, 75, c(.011,.3,.22,.18,.289)))))
y<-factor(c(rep("A", 30), rep("B", 30)))
y0<-factor(c(rep("A", 5), rep("B", 55)))
require(vegan)
dm<-vegdist(x, method="bray")
dm<-data.matrix(dm)
DistBoxplot(dm, y, dm_name="bray")

shihuang047/DistVis documentation built on Jan. 9, 2023, 10:39 p.m.