Re: [R] problem with certain data sets when using randomForest

2005-08-31 Thread Liaw, Andy
I've been trying to play catch-up on R-help since DSC2005. This one must have slipped through... This is what I'd do: iris.sub - subset(iris, Species %in% c(setosa, virginica)) iris.sub$Species - factor(iris.sub$Species) That last line drops the empty level in the factor. You can then run

[R] problem with certain data sets when using randomForest

2005-08-26 Thread Martin Lam
Hi, Since I've had no replies on my previous post about my problem I am posting it again in the hope someone notice it. The problem is that the randomForest function doesn't take datasets which has instances only containing a subset of all the classes. So the dataset with instances that either

Re: [R] problem with certain data sets when using randomForest

2005-08-26 Thread Prof Brian Ripley
Look at ?[.factor: finaldataset$Species - finaldataset$Species[,drop=TRUE] solves this. On Fri, 26 Aug 2005, Martin Lam wrote: Hi, Since I've had no replies on my previous post about my problem I am posting it again in the hope someone notice it. The problem is that the

Re: [R] problem with certain data sets when using randomForest

2005-08-26 Thread Martin Lam
Thank you for this and earlier help Mr. Ripley. Martin --- Prof Brian Ripley [EMAIL PROTECTED] wrote: Look at ?[.factor: finaldataset$Species - finaldataset$Species[,drop=TRUE] solves this. On Fri, 26 Aug 2005, Martin Lam wrote: Hi, Since I've had no replies on my