R: Set a user defined slot

setNdOther {treeman} | R Documentation

## Set a user defined slot

### Description

Return a tree with a user defined slot for node ID.

### Usage

    setNdOther(tree, id, val, slt_nm)

### Arguments

`tree` | `TreeMan` object
`id` | id of the node
`val` | data for slot
`slt_nm` | slot name

### Details

A user can specify new slots in a tree. Add a new slot with this function by providing a node ID, a value for the new slot and a unique new slot name. Slot names must not be default `TreeMan` names. The new value can be any data type.

### See Also

`setNdsOther` https://github.com/DomBennett/treeman/wiki/set-methods

### Examples

    library(treeman)
    tree <- randTree(10)
    tree <- setNdOther(tree, 't1', 1, 'binary_val')
    tree <- updateSlts(tree)
    (getNdSlt(tree, id='t1', slt_nm='binary_val'))

[Package treeman version 1.1.4 Index]