getAncestryNode: retrieves path from node to root

Description Usage Arguments Value See Also Examples

Description

Extracts the path from the specified node to the root of the tree.

Usage

1
getAncestryNode(indNode = integer(), tree = matrix())

Arguments

indNode

An integer. Specifies the node for which to retrieve the path.

tree

A tree of a randomForest that is returned by getTree.

Value

A numeric vector. The names indicate the ancestor nodes, the values the variables used to split the according node. First element of the vector is the closest relative, the last element represents the root.

See Also

getAncestryTree, getAncestryForest

Examples

1
2
3
4
5
6
7
8
9
## data
YX <- simulateSNPdata(seed = 123)

## forest
rF <- randomForest(x = YX[ , -1], y = YX[ , 1], keep.forest = TRUE, 
		keep.inbag = TRUE, importance = TRUE, ntree = 500)

## ancestry		
getAncestryNode(indNode = 104, tree = getTree(rF, 1))

adibender/rFtools documentation built on May 14, 2019, 5:13 a.m.