amp_export_otutable: Export OTU-table

View source: R/amp_export_otutable.R

amp_export_otutableR Documentation

Export OTU-table

Description

Export otutable (including taxonomy) from an ampvis2 object as CSV using write.table.

Usage

amp_export_otutable(
  data,
  filename = "exported_otutable",
  extension = "csv",
  md5 = FALSE,
  sep = "\t",
  id = NULL,
  sort_samples = NULL,
  normalise = FALSE,
  ...
)

Arguments

data

(required) Data list as loaded with amp_load.

filename

File name of the exported OTU-table (excluding extension). (default: "exported_otutable")

extension

File extension (without "."). (default: "csv")

md5

(logical) Compute md5 sum of the data (the whole R-object, not just otutable) and append to the filename. (default: FALSE)

sep

Separator passed directly to fwrite. (default: "\t")

id

Name the samples using a variable in the metadata.

sort_samples

Vector to sort the samples by.

normalise

(logical) Transform the OTU read counts to be in percent per sample. (default: FALSE)

...

Additional arguments passed on to fwrite (other than sep).

Author(s)

Kasper Skytte Andersen ksa@bio.aau.dk

Mads Albertsen MadsAlbertsen85@gmail.com

Examples

# Load example data
data("AalborgWWTPs")

# Export OTU-table
## Not run: 
amp_export_otutable(AalborgWWTPs, md5 = TRUE, filename = "AalborgWWTPs_otutable", sep = "\\t")

## End(Not run)


MadsAlbertsen/ampvis2 documentation built on May 21, 2024, 2:11 p.m.