ggrarecurve: Rarefaction alpha index

View source: R/plot-ggrarecurve.R

ggrarecurveR Documentation

Rarefaction alpha index

Description

Rarefaction alpha index

Usage

ggrarecurve(obj, ...)

## S3 method for class 'phyloseq'
ggrarecurve(obj, chunks = 400, factorLevels = NULL, ...)

## S3 method for class 'data.frame'
ggrarecurve(obj, sampleda, factorLevels, chunks = 400, ...)

## S3 method for class 'rarecurve'
ggrarecurve(
  obj,
  indexNames = "Observe",
  linesize = 0.5,
  facetnrow = 1,
  shadow = TRUE,
  factorNames,
  se = FALSE,
  method = "lm",
  formula = y ~ log(x),
  ...
)

Arguments

obj

phyloseq, phyloseq class or data.frame shape of data.frame (nrow sample * ncol feature ( + factor)).

...

additional parameters, see also ggplot2{ggplot}.

chunks

integer, the number of subsample in a sample, default is 400.

factorLevels

list, the levels of the factors, default is NULL, if you want to order the levels of factor, you can set this.

sampleda

data.frame, (nrow sample * ncol factor)

indexNames

character, default is "Observe", only for "Observe", "Chao1", "ACE".

linesize

integer, default is 0.5.

facetnrow

integer, the nrow of facet, default is 1.

shadow

logical, whether merge samples with group (factorNames) and display the ribbon of group, default is TRUE.

factorNames

character, default is missing.

se

logical, default is FALSE.

method

character, default is lm.

formula

formula, default is 'y ~ log(x)'

Value

figure of rarefaction curves

Author(s)

Shuangbin Xu

Examples

## Not run: 
data(test_otu_data)
test_otu_data %<>% as.phyloseq()
library(ggplot2)
prare <- ggrarecurve(test_otu_data,
               indexNames=c("Observe","Chao1","ACE"),
               shadow=FALSE,
               factorNames="group"
         ) +
         theme(legend.spacing.y=unit(0.02,"cm"),
               legend.text=element_text(size=6))

## End(Not run)

xiangpin/MicrobiotaProcess documentation built on Nov. 12, 2024, 2:05 p.m.