ggbartax {MicrobiotaProcess} | R Documentation

## taxonomy barplot

### Description

taxonomy barplot

### Usage

    ggbartax(obj, ...)

    ## S3 method for class 'phyloseq'
    ggbartax(obj, ...)

    ## Default S3 method:
    ggbartax(
      obj,
      mapping = NULL,
      position = "stack",
      stat = "identity",
      width = 0.7,
      topn = 30,
      count = FALSE,
      sampleda = NULL,
      factorLevels = NULL,
      facetNames = NULL,
      plotgroup = FALSE,
      groupfun = mean,
      ...
    )

### Arguments

`obj` | phyloseq, phyloseq class or data.frame, (nrow sample * ncol feature (factor)) or the data.frame for geom_bar.
`...` | additional parameters, see `ggplot`
`mapping` | set of aesthetic mapping of ggplot2, default is NULL, if the data is the data.frame for geom_bar, the mapping should be set.
`position` | character, default is 'stack'.
`stat` | character, default is 'identity'.
`width` | numeric, the width of bar, default is 0.7.
`topn` | integer, the top number of abundance taxonomy(feature).
`count` | logical, whether show the relative abundance.
`sampleda` | data.frame, (nrow sample * ncol factor), the sample information, if the data doesn't contain the information.
`factorLevels` | list, the levels of the factors, default is NULL, if you want to order the levels of factor, you can set this.
`facetNames` | character, default is NULL.
`plotgroup` | logical, whether calculate the mean or median etc for each group, default is FALSE.
`groupfun` | character, how to calculate for feature in each group, the default is 'mean', this will plot the mean of feature in each group.

### Value

barplot of tax

### Author(s)

Shuangbin Xu

### Examples

    library(ggplot2)
    data(test_otu_data)
    otubar <- ggbartax(test_otu_data) +
             xlab(NULL) + ylab("relative abundance(%)")

[Package MicrobiotaProcess version 1.0.5 Index]