Solve the error of "binary column operator has non-numeric parameter" in R language!
Problem Description
When I used R to reproduce a random forest classification problem today, the following error occurred when running the random forest calculation:
Error in y - ymean : 二进列运算符中有非数值参数
R version: R4.0.3
problem exploration
At first I thought there was a problem with the data and checked the data. Tried with as.numeric
conversion a few times, but still can't solve the problem. I can't find any solution online to solve my problem.
problem solved
After asking a big guy (little white fish), he gave the following plan.
Change the r version .
Perfect solution after trying it.
Detailed method
-
Download the R language of the lower version (recommended R3.6) on the official website. https://cran.r-project.org/bin/windows/base/old/
-
Switch the R version in Rstudio.
Open RStudio —> click Tools —> Global Options —> General —> R version —> Change as follows