\Header{post.rpart}{PostScript Presentation Plot of an Rpart Object}
\alias{post}{post.rpart}
\keyword{tree}{post.rpart}
\begin{Description}\relax
Generates a PostScript presentation plot of an \code{rpart} object.\end{Description}
\begin{Usage}
\begin{verbatim}
post(tree, ...)

## S3 method for class 'rpart':
post(tree, title., 
     filename = paste(deparse(substitute(tree)), ".ps", sep = ""), 
     digits = getOption("digits") - 3, pretty = TRUE,
     use.n = TRUE, horizontal = TRUE, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{tree}] fitted model object of class \code{rpart}.  This is assumed to be the result 
of some function that produces an object with the same named 
components as that returned by the \code{rpart} function. 

\item[\code{title.}] a title which appears at the top of the plot.  By default, the 
name of the \code{rpart} endpoint is printed out. 

\item[\code{filename}] ASCII file to contain the output.  By default, the name of the file is 
the name of the object given by \code{rpart} (with the suffix \code{.ps} added). If 
\code{filename = ""}, the plot appears on the current graphical device. 

\item[\code{digits}] number of significant digits to include in numerical data. 

\item[\code{pretty}] an integer denoting the extent to which factor levels will be 
abbreviated in the character strings defining the splits; 
(0) signifies no abbreviation of levels.  A \code{NULL} signifies using 
elements of letters to represent the different factor levels.  The 
default (\code{TRUE}) indicates the maximum possible abbreviation. 

\item[\code{use.n}] Logical.  If \code{TRUE} (default), adds to label 
(\#events level1/ \#events level2/etc. for method \code{class}, \code{n} for 
method \code{anova}, and \#events/n for methods \code{poisson} and \code{exp}).

\item[\code{horizontal}] Logical.  If \code{TRUE} (default), plot is horizontal. If \code{FALSE}, plot 
appears as landscape. 

\item[\code{...}] other arguments to the \code{postscript} function. 

\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The plot created uses the functions \code{plot.rpart} and \code{text.rpart} (with 
the \code{fancy} option).  The settings were chosen because they looked 
good to us, but other options may be better, depending on the \code{rpart} 
object.   
Users are encouraged to write their own function containing favorite 
options.\end{Details}
\begin{Section}{Side Effects}
a plot of \code{rpart} is created using the \code{postscript} driver, or
the current device if \code{filename = ""}.\end{Section}
\begin{SeeAlso}\relax
\code{\Link{plot.rpart}},  \code{\Link{rpart}},  \code{\Link{text.rpart}},  \code{\Link{abbreviate}}\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(car.test.frame)
z.auto <- rpart(Mileage ~ Weight, car.test.frame)
post(z.auto, file = "")   # display tree on active device
   # now construct postscript version on file "pretty.ps"
   # with no title
post(z.auto, file = "pretty.ps", title = " ")
z.hp <- rpart(Mileage ~ Weight + HP, car.test.frame)
post(z.hp)
\end{ExampleCode}
\end{Examples}

