Learn R Programming

maptree (version 1.4-9)

group.tree: Observation Groups for Classification or Regression Tree

Description

Alternative to tree[["where"]] that orders groups from left to right in draw order.

Usage

group.tree (tree)

Value

Vector of rearranged tree[["where"]]

Arguments

tree

object of class rpart or tree.

Author

Denis White

Details

Normally used with map.groups. See example.

See Also

rpart, map.groups

Examples

Run this code
  library (rpart)
  data (oregon.env.vars, oregon.grid)

  group <- group.tree (clip.rpart (rpart (oregon.env.vars), best=7))
  names(group) <- row.names(oregon.env.vars)
  map.groups (oregon.grid, group=group)

Run the code above in your browser using DataLab