% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/merge2.R
\name{merge2}
\alias{merge2}
\title{Merge two data frames and return the result with the contribution indices}
\usage{
merge2(x, y, ..., .inx. = "in.x", .iny. = "in.y")
}
\arguments{
\item{x}{First data frame.}

\item{y}{Second data frame.}

\item{...}{parameters to the native merge frunction.}

\item{.inx.}{The name of the contribution index for x.}

\item{.iny.}{The name of the contribution index for y.}
}
\description{
Merge two data frames and return the result with the contribution indices
}
\details{
The SAS like contribution indices will be returned as the variables
of the merged data frame.

In the followint example, those observations with \code{in.x=1} are
contributed from data frame x, and those with \code{in.y=1}, from y.
}
\examples{
d1 <- data.frame(x=c(11:15, 17:20),y=c(111:115, 117:120))
d1[2,2] <- NA
d2 <- data.frame(x=c(11:13, 16, 18:21),y=c(211:213, 216, 218:221))
d2[5,2] <- NA
d12 <- merge2(d1,d2, by="x", all=TRUE)
printm( d1, d2, d12 )

D12 <- merge2(d1,d2, by="x", all=TRUE, .inx.="IN1")
printm( d1, d2, D12 )

}
