group.tree {maptree}R Documentation

Observation Groups for Classification or Regression Tree

Description

Alternative to tree[["where"]] that orders groups from left to right in draw order, and adds group membership of observations to pts matrix if provided.

Usage

  group.tree (tree, pts=NULL)

Arguments

tree object of class "tree".
pts vector, matrix, or data frame of length or nrow equal to length(tree[["where"]]) to which group vector is joined with cbind.

Details

Normally used with map.groups. See example.

Value

Vector of rearranged tree[["where"]] or the cbind of pts and this vector if pts != NULL.

Author(s)

Denis White, white.denis@epa.gov

See Also

tree, map.groups

Examples

  library (tree)
  data (hex.env, oregon)

  map.groups (group.tree (prune.tree (tree (hex.env),
      best=6), pts=hex.env), lns=oregon)