\name{binByRef}
\alias{binByRef}

\title{ Bin a test data set using bins previously created by probability
  binning  a control dataset}

\description{
The bins generated by probability binning a control data set can be applied to a
test data set to perfom statistical comparisions by methods such as the
Chi-squared test or the probability binning statistic.
}

\usage{
binByRef(binRes, data)
}

\arguments{
  
  \item{binRes}{ The result generated by calling teh \code{probBin}
    function on a control dataset.}

  \item{data}{ An object of class
  \code{\link[flowCore:flowFrame-class]{flowFrame}}} 
  

}

\value{

  An enviroment containing the matrices for each bin of the test data set
}

\author{ Nishant Gopalakrishnan }

\seealso{ \code{\link{plotBins}}, \code{\link{proBin}}}

\examples{
library(flowCore)
data(GvHD)
resCtrl<-proBin(GvHD[[1]],200)  
resSample<-binByRef(resCtrl,GvHD[[2]])
ls(resSample)
}

\keyword{misc}
