% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/amp_frequency.R
\name{amp_frequency}
\alias{amp_frequency}
\title{Frequency plot}
\usage{
amp_frequency(
  data,
  group_by = "Sample",
  tax_class = NULL,
  tax_empty = "best",
  tax_aggregate = "OTU",
  weight = TRUE,
  normalise = TRUE,
  detailed_output = FALSE
)
}
\arguments{
\item{data}{(\emph{required}) Data list as loaded with \code{\link{amp_load}}.}

\item{group_by}{Group the samples by a variable in the metadata. (\emph{default:} \code{"Sample"})}

\item{tax_class}{Converts a specific phylum to class level instead, e.g. \code{"p__Proteobacteria"}.}

\item{tax_empty}{How to show OTUs without taxonomic information. One of the following:
\itemize{
   \item \code{"remove"}: Remove OTUs without taxonomic information.
   \item \code{"best"}: (\emph{default}) Use the best classification possible.
   \item \code{"OTU"}: Display the OTU name.
   }}

\item{tax_aggregate}{The taxonomic level to aggregate the OTUs. (\emph{default:} \code{"OTU"})}

\item{weight}{(\emph{logical}) Weight the frequency by abundance. (\emph{default:} \code{TRUE})}

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

\item{detailed_output}{(\emph{logical}) Return additional details or not. If \code{TRUE}, it is recommended to save to an object and then access the additional data by \code{View(object$data)}. (\emph{default:} \code{FALSE})}
}
\value{
A ggplot2 object. If \code{detailed_output = TRUE} a list with a ggplot2 object and additional data.
}
\description{
Generates a barplot with frequency vs read abundance.
}
\section{Preserving relative abundances in a subset of larger data}{

See \code{?\link{amp_filter_samples}} or the \href{https://kasperskytte/ampvis2/articles/faq.html#preserving-relative-abundances-in-a-subset-of-larger-data}{ampvis2 FAQ}.
}

\examples{
# Load example data
data("AalborgWWTPs")

# Frequency plot
amp_frequency(AalborgWWTPs)
}
\references{
Saunders, Aaron M; Albertsen, Mads; Vollertsen, Jes; Nielsen, Per H (2016): The activated sludge ecosystem contains a core community of abundant organisms, ISME Journal 10, 11-20. \doi{10.1038/ismej.2015.117}
}
\seealso{
\code{\link{amp_load}}, \code{\link{amp_core}}, \code{\link{amp_venn}}
}
\author{
Kasper Skytte Andersen \email{ksa@bio.aau.dk}

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