\HeaderA{get.tree.levels}{Function for constructing level vectors}{get.tree.levels}
\keyword{misc}{get.tree.levels}
\begin{Description}\relax
Function that assignes to each node the level at which that node is
in a specific tree (\code{tree.num}) of the mutagenetic trees mixture model \code{mixture}.
The \code{start.val} is the number assigned to the events pruned from
the tree. This usually is the maximum depth of the tree with which the
tree specified with \code{tree.num} will be compared.
\end{Description}
\begin{Usage}
\begin{verbatim}
get.tree.levels(mixture, tree.num, start.val)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{mixture}] An object of the class \code{RtreemixModel}.
\item[\code{tree.num}] A \code{numeric} specifying the tree component from
\code{mixture} used for creating the level vector.
\item[\code{start.val}] A \code{numeric} specifying the number assigned to
the pruned events.
\end{ldescription}
\end{Arguments}
\begin{Value}
The function returns a named \code{numeric} vector. Its length equals the
number of genetic events in \code{mixture} minus one (for the initial
null event which is always on level 0). The vector names correspond to
the names of the genetic events and each vector component gives the
level at which the respective event is in the \code{num.tree} tree of \code{mixture}.
\end{Value}
\begin{Author}\relax
Jasmina Bogojeska
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{comp.models}{comp.models}}, \code{\LinkA{comp.trees}{comp.trees}}, \code{\LinkA{stability.sim}{stability.sim}}, 
\code{\LinkA{RtreemixModel-class}{RtreemixModel.Rdash.class}}, \code{\LinkA{fit-methods}{fit.Rdash.methods}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
## Generate two random RtreemixModel objects each with 3 components.
rand.mod <- generate(K = 3, no.events = 9, noise.tree = TRUE, prob =
c(0.2, 0.8))

## Get the tree levels of the 2nd component of the model rand.mod.
get.tree.levels(mixture = rand.mod, tree.num = 2, start.val = 10)
\end{ExampleCode}
\end{Examples}

