getLayerTree: retrieves the layer for all nodes of a tree

Description Usage Arguments Value See Also Examples

Description

For a given tree this function returns the layer for each not terminal node.

Usage

1
getLayerTree(ancestryTreeObj = list())

Arguments

ancestryTreeObj

A list as it is returned by getAncestryTree.

Value

A vector with each element indicating the layer of the according (not terminal) node.

See Also

getLayerForest, getAncestryTree

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## 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
aT1 <- getAncestryTree(getTree(rF, 1))

## layer
getLayerTree(aT1) ## layers of the not terminal nodes of tree 1

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