[R] Party extract BinaryTree from cforest?

Chris Hane
Wed, 05 Oct 2011 17:55:08 -0000

Hello,

I want to plot one of the trees from a cforest object:
>data(iris)
>cf <- cforest(Species, data=iris)

>From the docs, cf@ensemble contains a list of BinaryTrees:
ensemble: Object of class "list", each element being an object of
class "
BinaryTree <../../party/help/BinaryTree%2dclass>". So I want to
call
>plot(  cf@ensemble[[1]])
Error in xy.coords(x, y, xlabel, ylabel, log) :
'x' is a list, but does not have components 'x' and 'y'

but cf@ensemble[[1]] is still a list object not a BinaryTree.

How can I extract the tree at node k, like randomForest::getTree() ?

Thanks,
Chris

	[[alternative HTML version deleted]]