% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/amp_otu_network.R
\name{amp_otu_network}
\alias{amp_otu_network}
\title{Network plot}
\usage{
amp_otu_network(
  data,
  min_abundance = 0,
  color_by = NULL,
  tax_aggregate = "Phylum",
  tax_add = NULL,
  tax_show = 10,
  tax_class = NULL,
  tax_empty = "best",
  normalise = TRUE,
  ...
)
}
\arguments{
\item{data}{(\emph{required}) Data list as loaded with \code{\link{amp_load}}.}

\item{min_abundance}{Minimum taxa abundance pr. sample. (\emph{default:} \code{0})}

\item{color_by}{A metadata variable to color the samples by.}

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

\item{tax_add}{Additional taxonomic level(s) to display, e.g. \code{"Phylum"}. (\emph{default:} \code{"none"})}

\item{tax_show}{The number of taxa to show, or a vector of taxa names. (\emph{default:} \code{10})}

\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{normalise}{(\emph{logical}) Transform the OTU read counts to be in percent per sample. (\emph{default:} \code{TRUE})}

\item{...}{Additional arguments passed on to \code{\link[GGally]{ggnet2}}.}
}
\value{
A ggplot2 object. If \code{detailed_output = TRUE} a list with a ggplot2 object and additional data.
}
\description{
Generates network plot of taxa and samples based on ggnet2.
}
\details{
See \code{\link[GGally]{ggnet2}}
}
\section{Preserving relative abundances in a subset of larger data}{

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

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

# OTU network plot
amp_otu_network(AalborgWWTPs)
}
\seealso{
\code{\link{amp_load}}
}
\author{
Kasper Skytte Andersen \email{ksa@bio.aau.dk}

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