% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/amp_export_otutable.R
\name{amp_export_otutable}
\alias{amp_export_otutable}
\title{Export OTU-table}
\usage{
amp_export_otutable(
  data,
  filename = "exported_otutable",
  extension = "csv",
  md5 = FALSE,
  sep = "\\t",
  id = NULL,
  sort_samples = NULL,
  normalise = FALSE,
  ...
)
}
\arguments{
\item{data}{(\emph{required}) Data list as loaded with \code{\link{amp_load}}.}

\item{filename}{File name of the exported OTU-table (excluding extension). (\emph{default:} \code{"exported_otutable"})}

\item{extension}{File extension (without \code{"."}). (\emph{default:} \code{"csv"})}

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

\item{sep}{Separator passed directly to \code{\link[data.table]{fwrite}}. (\emph{default:} \code{"\t"})}

\item{id}{Name the samples using a variable in the metadata.}

\item{sort_samples}{Vector to sort the samples by.}

\item{normalise}{(\emph{logical}) Transform the OTU read counts to be in percent per sample. (\emph{default:} \code{FALSE})}

\item{...}{Additional arguments passed on to \code{\link[data.table]{fwrite}} (other than \code{sep}).}
}
\description{
Export otutable (including taxonomy) from an ampvis2 object as CSV using \code{\link{write.table}}.
}
\examples{
# Load example data
data("AalborgWWTPs")

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

}
\author{
Kasper Skytte Andersen \email{ksa@bio.aau.dk}

Mads Albertsen \email{MadsAlbertsen85@gmail.com}
}
