post.itree: PostScript Presentation Plot of an itree Object

Description Usage Arguments Side Effects See Also Examples

View source: R/post.itree.R

Description

Generates a PostScript presentation plot of an itree object. Identical to the function in rpart.

Usage

1
2
3
4
5
6
7
post(tree, ...)

## S3 method for class 'itree'
post(tree, title., 
     filename = paste(deparse(substitute(tree)), ".ps", sep = ""), 
     digits = getOption("digits") - 3, pretty = TRUE,
     use.n = TRUE, horizontal = TRUE, ...)

Arguments

tree

fitted model object of class itree. This is assumed to be the result of some function that produces an object with the same named components as that returned by the itree function.

title.

a title which appears at the top of the plot. By default, the name of the itree endpoint is printed out.

filename

ASCII file to contain the output. By default, the name of the file is the name of the object given by itree (with the suffix .ps added). If filename = "", the plot appears on the current graphical device.

digits

number of significant digits to include in numerical data.

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 NULL signifies using elements of letters to represent the different factor levels. The default (TRUE) indicates the maximum possible abbreviation.

use.n

Logical. If TRUE (default), adds to label (\#events level1/ \#events level2/etc. for method class, n for method anova.

horizontal

Logical. If TRUE (default), plot is horizontal. If FALSE, plot appears as landscape.

...

other arguments to the postscript function.

Side Effects

a plot of itree is created using the postscript driver, or the current device if filename = "".

See Also

plot.itree, itree, text.itree, abbreviate

Examples

1
2
3
4
5
6
7
8
#the rpart examples:
z.auto <- itree(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 <- itree(Mileage ~ Weight + HP, car.test.frame)
post(z.hp)

Example output

itree is based on the code of rpart.
Bug reports should be directed to this package's maintainer, not rparts'.

itree documentation built on May 2, 2019, 7:25 a.m.

Related to post.itree in itree...