collapse_replicates {microbiome} | R Documentation

## Collapse Replicate Samples

### Description

Collapse samples, mostly meant for technical replicates.

### Usage

    collapse_replicates(
      x,
      method = "sample",
      replicate_id = NULL,
      replicate_fields = NULL
    )

### Arguments

`x` | `phyloseq-class` object
`method` | Collapsing method. Only random sampling ("sample") implemented.
`replicate_id` | Replicate identifier. A character vector.
`replicate_fields` | Metadata fields used to determine replicates.

### Value

Collapsed phyloseq object.

### Author(s)

Contact: Leo Lahti microbiome-admin@googlegroups.com

### References

To cite the microbiome R package, see citation('microbiome')

### Examples

    data(atlas1006)
    pseq <- collapse_replicates(atlas1006,
            method = "sample",
            replicate_fields = c("subject", "time"))

[Package microbiome version 1.12.0 Index]