rpart2gNEL {RbcBook1} | R Documentation

## rpart to graphNEL Converter

### Description

Creates an object of class `graphNEL` from one of class `rpart`.

### Usage

    rpart2gNEL(tr, remap=function(x) x, nsep="\n")

### Arguments

`tr` | instance of `rpart` class from `rpart` package.
`remap` | function that maps node names in tree to node names in graph.
`nsep` | token that separates node name and vote tally in the rendering.

### Details

Not explicitly used in the book, but the basis for a certain graph illustrating application of rpart. The newer coin/party packages have more interesting rendering approaches based on graphviz.

`grabSplitV` is a utility function for acquiring the variable names, `remapAff` will remap affymetrix probe names to gene symbols for use in the `remap` parameter.

### Value

a `graphNEL-class` instance with nodes constructed to convey information on the data tree fit

### Author(s)

Vince Carey <stvjc@channing.harvard.edu>

### See Also

`rpart`, `graphNEL-class`

### Examples

    library(rpart)
    example(rpart)
    ff = rpart2gNEL(fit2)
    ff
    nodes(ff)

[Package RbcBook1 version 1.60.0 Index]