\HeaderA{oneRowPerId}{Rearrange dataframe entries such that there is exactly one row
per ID.}{oneRowPerId}
\keyword{manip}{oneRowPerId}
\begin{Description}\relax
Rearrange dataframe entries such that there is exactly one row
per ID. The IDs are taken from the argument \code{ids} and are matched
against the first column of \code{x}. If an ID is missing in \code{x[,1]},
a row with \code{NA} values is inserted. If an ID occurs multiple times
in \code{x[,1]}, rows are collapsed into characters of comma-separated values.
\end{Description}
\begin{Usage}
\begin{verbatim}
oneRowPerId(x, ids)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] dataframe.
\item[\code{ids}] character vector.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
\end{Details}
\begin{Value}
A dataframe whose rows correspond 1:1 to \code{ids}.
\end{Value}
\begin{Author}\relax
W. Huber \email{huber@ebi.ac.uk}, Ligia Pedroso Bras \email{ligia@ebi.ac.uk}
\end{Author}
\begin{Examples}
\begin{ExampleCode}
x = data.frame(ids=I(c("a", "a", "c")), val=11:13)
oneRowPerId(x, letters[1:3])
\end{ExampleCode}
\end{Examples}

