% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/align.R
\name{ancestors}
\alias{ancestors}
\title{Ancestors indexes of a subject}
\usage{
ancestors(idx, momx, dadx)
}
\arguments{
\item{idx}{Indexes of the subjects}

\item{momx}{Indexes of the mothers}

\item{dadx}{Indexes of the fathers}
}
\value{
A vector of ancestor indexes
}
\description{
Given the index of one or multiple individual(s), this
function iterate through the mom and dad indexes to
list out all the ancestors of the said individual(s).
This function is use in the \code{\link[=align]{align()}} function to
identify which spouse pairs has a common ancestor and
therefore if they need to be connected with a double line
(i.e. inbred).
}
\examples{
ancestors(c(1), c(3, 4, 5, 6), c(7, 8, 9, 10))
ancestors(c(1, 2), c(3, 4, 5, 6), c(7, 8, 9, 10))
}
\seealso{
\code{\link[=align]{align()}}
}
\keyword{internal}
