Learn R Programming

maptree (version 1.4-8)

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)

Arguments

tree

object of class rpart or tree.

Value

Vector of rearranged tree[["where"]]

Details

Normally used with map.groups. See example.

See Also

rpart, map.groups

Examples

Run this code
# NOT RUN {
  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