Skip to content
Back to formatted view

Raw Message

Message-ID: <3D6DD395.E6ADAC3E@statistik.uni-dortmund.de>
Date: 2002-08-29T07:56:05Z
From: Uwe Ligges
Subject: unlist (rpart.object.list)

chr.schulz at email.de wrote:
> 
> Hello,
> can me please help anbody how it is possible
> unlist a "rpart.object.list" i.e. from bagging(ipred) to
> plot this "unique" several rpart.objects .
> 
> ..i make attempts with unlist, get really atomic
> elements, but need only the different tree's !

Right, that's what unlist() does.


In ?bagging (package ipred), you will find in section "Value":

  Value 
  An object of class bagging: a list containing the following objects 

  mt   list of length nbagg containing rpart trees. 


So, following the first example in ?bagging, you get a list of trees
with:

 X <- as.data.frame(matrix(rnorm(1000), ncol=10))
 y <- factor(ifelse(apply(X, 1, mean) > 0, 1, 0))
 learn <- cbind(y, X)

 mt <- bagging(y ~., data=learn, coob=TRUE)
 mt$mt

Uwe Ligges
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._