Skip to content

problem with certain data sets when using randomForest

1 message · 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
randomForest with that data.

HTH,
Andy