% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sequence-consensus-groups.R
\name{plot_consensus_sequence}
\alias{plot_consensus_sequence}
\title{Plot a consensus sequence}
\usage{
plot_consensus_sequence(
  consensus,
  type = c("agreement", "states"),
  group = NULL,
  main = NULL,
  xlab = "Sequence position",
  ylab = NULL,
  ...
)
}
\arguments{
\item{consensus}{A consensus result.}

\item{type}{\code{"agreement"} or \code{"states"}.}

\item{group}{Optional group value, encoded group key, or named list of
values when grouped consensus was created. It is required when more than one
consensus group is present.}

\item{main, xlab, ylab}{Plot labels.}

\item{...}{Additional arguments passed to base graphics.}
}
\value{
The plotted data, invisibly.
}
\description{
Plot a consensus sequence
}
\examples{
sequences <- data.frame(
  sequence_id = rep(c("s1", "s2", "s3", "s4"), each = 4L),
  sequence_order = rep(1:4, times = 4L),
  state = c("A", "B", "C", "D", "A", "B", "C", "C",
            "D", "C", "B", "A", "D", "C", "A", "A"),
  group = rep(c("g1", "g2"), each = 8L),
  stringsAsFactors = FALSE
)
consensus <- create_consensus_sequence(sequences)
plot_consensus_sequence(consensus)

}
