% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/markov.R
\name{simMarkov}
\alias{simMarkov}
\title{Convert nlmixr2 simulations to Markov states}
\usage{
simMarkov(
  ui,
  initialState,
  states,
  colPrev = "previous",
  colCur = "current",
  ...
)
}
\arguments{
\item{ui}{a model fit or simulation object to simulate from or a data.frame
containing the transition probability columns}

\item{initialState}{The initial Markov state}

\item{states}{All states in the model as a character vector}

\item{colPrev, colCur}{Column names in the dataset for the previous and
current states (may be any R object that can be coerced to a character
string, ordered objects are usually preferred)}

\item{...}{Passed to methods}
}
\value{
A data.frame with the original data along with the new state columns
  (`colPrev` and `colCur`) added
}
\description{
Simulations are performed per sim.id (if applicable) and per subject id
within the simulation. The `sim.id` column must be named exactly that, and
the `id` column is detected case-insensitvely.
}
\details{
See the Markov vignette (\code{vignette("markov", package = "nlmixr2lib")})
for an example.
}
\seealso{
Other Markov models:
\code{\link[=createMarkovModel]{createMarkovModel()}},
\code{\link[=createMarkovModelDataset]{createMarkovModelDataset()}},
\code{\link[=createMarkovModelFromSingleState]{createMarkovModelFromSingleState()}},
\code{\link[=createMarkovTransitionMatrix]{createMarkovTransitionMatrix()}},
\code{\link[=simMarkovId]{simMarkovId()}}
}
\concept{Markov models}
