\HeaderA{rect.box.idx}{Superimposes a rectangle on an existing plot given positional indicies}{rect.box.idx}
\keyword{hplot}{rect.box.idx}
\begin{Description}\relax
The boundaries of a rectangle are determined from a vector of
positional indicies 'box.idx' and the given variables, 'x1' and 'x2'.
This box is then displayed on the existing plot.
\end{Description}
\begin{Usage}
\begin{verbatim}
rect.box.idx(x1, x2, box.idx = NULL,
    original.data.idx = 1:length(x1),
    border = "black", lwd = 3, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x1}] vector of values for variable 1
\item[\code{x2}] vector of values for variable 2
\item[\code{box.idx}] vector of positional indicies that indicate the box to
be shown
\item[\code{original.data.idx}] positional values of the current 'x1' and
'x2' observations
\item[\code{border}] the color of the outline of the box or rectangle
\item[\code{lwd}] the width of the lines of the box
\item[\code{...}] other options in \LinkA{rect}{rect}
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
This function would be coupled with the use of
\LinkA{ContourScatterPlot}{ContourScatterPlot} to show the boxes obtained by 'do.PRIM'
(Patient Rule Induction Method) from the
\pkg{rfcprim} package.  PRIM is a semi-automated bump-hunting program.
\end{Details}
\begin{Value}
\end{Value}
\begin{Author}\relax
A.J. Rossini and J.Y. Wan
\end{Author}
\begin{References}\relax
See details in \pkg{rfcprim}
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{ContourScatterPlot}{ContourScatterPlot}}, \pkg{rfcprim} library
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
if (require(rfcdmin)){

data(PRIM.example.data)
  

if (require(rfcprim)){

## only the peeling step is implemented
out.peel <- peel.step(X.PRIM, Y.PRIM)

if (interactive()){
ContourScatterPlot(X.PRIM[,1], X.PRIM[,2],  status=Y.PRIM,
   main="z statistic",
   xlab=col.nm[4],
   ylab=col.nm[5], image.col=heat.colors(20),plot.legend.CSP=TRUE)
## the Green box is the initial estimate of the first rule
## after the peeling step
rect.box.idx(out.peel@best.box.idx, X.PRIM[,1], X.PRIM[,2], border="green")
}
}
}
\end{ExampleCode}
\end{Examples}

