[R] Error in y - ymean : non-numeric argument to binary operator

Peter Langfelder peter.langfelder at gmail.com
Sat May 27 07:21:53 CEST 2017

This is a bit of a shot in the dark since I haven't used randomForest
in several years, but I seem to recall that running randomForest
through the formula interface was asking for trouble... Try not using
the formula interface and specify the x, y, xtest arguments directly.


On Fri, May 26, 2017 at 8:54 PM, ddkssk 909 <ddkssk909c at gmail.com> wrote:
> I am trying to do classification with Randomforest() . the class variable
> is nominal.
> But I get this error
> model1 <-randomForest(Cath~.,data=trainrf)
> Error in y - ymean : non-numeric argument to binary operator
> In addition: There were 26 warnings (use warnings() to see them)
>>  model1
> Error: object 'model1' not found
>         [[alternative HTML version deleted]]
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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