[R] Can I define a object array in R?

Rui Barradas ruipbarradas at sapo.pt
Tue Jan 29 13:50:07 CET 2013


Hello,

You can store any kind of objects in a list. More or less like the 
following.

tlist <- vector("list", 100)

n <- 10
tlist[[n]] <- C5.0(...)


Hope this helps,

Rui Barradas

Em 29-01-2013 07:01, cuiyan escreveu:
> Here is my problem,
> 100 decision trees were built(similar to random forest) and I want to
> replace some of them by new trees.
> How can I define a tree array including 100 trees, i.e. t[100], and every
> t[n] is an "C5.0" object,
> such that
> when a new tree comes,  i can do
> n<-10
> t[n]<-C5.0(...)
>
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Can-I-define-a-object-array-in-R-tp4656909.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list