Usage
# f <- rpart(formula=y ~ x1 + x2 + \dots) # or rpart
"validate"(fit, method, B, bw, rule, type, sls, aics, force, estimates, pr=TRUE, k, rand, xval=10, FUN, ...)
"print"(x, ...)
"plot"(x, what=c("mse","dxy"), legendloc=locator, ...)
Arguments
fit
an object created by rpart
. You must have specified the
model=TRUE
argument to rpart
.
method,B,bw,rule,type,sls,aics,force,estimates
are there only for consistency with the generic validate
function; these are ignored
x
the result of validate.rpart
k
a sequence of cost/complexity values. By default these are obtained
from calling FUN
with no optional arguments or
from the rpart
cptable
object in the original fit object.
You may also specify a scalar or vector.
rand
a random sample (usually omitted)
FUN
the name of a function which produces a sequence of trees, such
prune
.
...
additional arguments to FUN
(ignored by print,plot
).
pr
set to FALSE
to prevent intermediate results for each k
to be printed
what
a vector of things to plot. By default, 2 plots will be done, one for
mse
and one for Dxy
.
legendloc
a function that is evaluated with a single argument equal to 1
to
generate a list with components x, y
specifying coordinates of the
upper left corner of a legend, or a 2-vector. For the latter,
legendloc
specifies the relative fraction of the plot at which to
center the legend.