I'm trying to construct a random forest for ecological data but keep getting the error
"no applicable method for 'importance' applied to an object of class "logical".
The code I have is:
fit2 <- randomForest(sv ~ salinity + temp + Depthbin + cdistance + oxygen +
type + diel, data=d.omit, importance(TRUE), ntree=2000)
The variable of interest (sv) is continuous, so I'm not sure if that impacts things. When I remove the importance(TRUE)
portion of the code, I can run the random forest but the IncNodePurity values I obtain are ridiculously high (some values over 100,000!!). I'm hoping the importance(TRUE)
addition will fix that, but if not, does anyone know of a better way to examine the importance of each variable?