Hello,
I'm trying to create a series of randomForest objects, basically in a
loop like this:
forests - list();
for (level in 1:10) {
# do some other things here
# create a random forest
forest - randomForest(
x = x.level,
y =
change
forests - c(forests, forest);
into
forests[[level]] - forest
On 1/6/07, Paul Boutros [EMAIL PROTECTED] wrote:
Hello,
I'm trying to create a series of randomForest objects, basically in a
loop like this:
forests - list();
for (level in 1:10) {
# do some other things
Howabout using 'lapply'?
forest - lapply(1:10, function(level) {
# do some other things here
# create and return a random forest
randomForest(x = x.level, y = z.level, ntree = trees)
})
# give meaningful names
names(forest) - paste(level, 1:10, sep = _)
Paul Boutros wrote:
Hello,
I'm