Identify Observations in Tree Nodes

DESCRIPTION:

Allows the user to identify observations in tree nodes.

USAGE:

identify.tree(x, nodes, print.it=T)

REQUIRED ARGUMENTS:

x
a fitted model object of class tree. This is assumed to be the result of some function that produces an object with the same named components as that returned by the tree function.
nodes
an integer vector containing indices (node numbers) of all nodes for which contents are desired. If missing, user selects nodes as described below.

OPTIONAL ARGUMENTS:

print.it
a logical value; if TRUE, the observations will be printed out as nodes are interactively selected. This argument is ignored if the nodes argument is supplied.

VALUE:

A named (by node) list, each element of which contains the names of all observations contained in that node.

GRAPHICAL INTERACTION:

A dendrogram of tree is expected to be visible on the graphics device, for which a graphics input device (eg a mouse) is required. Clicking (the selection button) on a node selects that node. This process may be repeated any number of times. Clicking the exit button will stop the selection process and return the list of observation names.

DETAILS:

This function is a method for the generic function for class tree. It can be invoked by calling for an object x of the appropriate class, or directly by calling regardless of the class of the object.

SEE ALSO:

, , .

EXAMPLES:

z.auto <- tree(Mileage ~ Weight, car.test.frame)
i2 <- identify(z.auto, 2)  # assign observations in node 2
# fit linear model to this subset
z2 <- lm(Mileage ~ Weight, car.test.frame, subset = i2)