\Header{merge.RGList}{Merge RGList Data Objects}
\keyword{manip}{merge.RGList}
\begin{Description}\relax
Merge two microarray data sets represented by RGLists.
\end{Description}
\begin{Usage}
\begin{verbatim}
## S3 method for class 'RGList':
merge(x,y,...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] \code{\Link{RGList-class}} object with list components \code{R}, \code{G}, \code{Rb} and \code{Gb} containing the foreground and background intensities for each spot on each array.
\item[\code{y}] \code{RGList} object, corresponding to the same genes as for \code{x}, possibly in a different order, but with different arrays.
\item[\code{...}] other arguments are accepted but not used at present
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
An \code{RGList} is a list object containing numeric matrices all of the same dimensions.
The RGLists are merged by merging each of the components by row names.
Unlike when using \code{\Link{cbind}}, row names are not required to be in the same order or to be unique.
In the case of repeated row names, the order of the rows with repeated names in preserved.
This means that the first occurrence of each name in \code{x\$R} is matched with the first occurrence of the same name in \code{y\$R}, the second with the second, and so on.
The final vector of row names is the same as in \code{x}.
\end{Details}
\begin{Value}
An \code{RGList} with the same components as \code{x}.
Component matrices have the same rows names as in \code{x} but columns from \code{y} as well as \code{x}.\end{Value}
\begin{Author}\relax
Gordon Smyth
\end{Author}
\begin{SeeAlso}\relax
R base provides a \code{\Link{merge}} method for merging data.frames.

An overview of limma commands for reading, subsetting and merging data is given in \link{3.ReadingData}.\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
R <- G <- matrix(11:14,4,2)
rownames(R) <- rownames(G) <- c("a","a","b","c")
RG1 <- new("RGList",list(R=R,G=G))

R <- G <- matrix(21:24,4,2)
rownames(R) <- rownames(G) <- c("b","a","a","c")
RG2 <- new("RGList",list(R=R,G=G))

merge(RG1,RG2)
merge(RG2,RG1)
\end{ExampleCode}
\end{Examples}

