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

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

Kasper Skytte Andersen ksa@bio.aau.dk

Mads Albertsen MadsAlbertsen85@gmail.com

Examples

# Load example data
data("AalborgWWTPs")

# Export OTU-table
if (FALSE) {
amp_export_otutable(AalborgWWTPs, md5 = TRUE, filename = "AalborgWWTPs_otutable", sep = "\\t")
}