% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sequence-adapters.R
\name{as_igraph_transition_network}
\alias{as_igraph_transition_network}
\title{Convert a transition network to an igraph object}
\usage{
as_igraph_transition_network(network, directed = TRUE)
}
\arguments{
\item{network}{A first-order transition network.}

\item{directed}{Whether the resulting graph is directed.}
}
\value{
An \code{igraph} graph with edge attributes copied from the network.
}
\description{
Convert a transition network to an igraph object
}
\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
)
network <- create_transition_network(sequences)
if (requireNamespace("igraph", quietly = TRUE)) {
  as_igraph_transition_network(network)
}

}
