How to produce this error
Here we can see, we have to take the string element and try to add it with a numeric element, so it will occur.
R
num <- "2" res <- num + 4 print (res) |
Output:
Error in num + 4: non-numeric argument to binary operator
How to Fix: non-numeric argument to binary operator in R
In this article, we will see How to Fix: non-numeric argument to the binary operator in R Programming Language.
The “non-numeric argument to binary operator” error occurs when we perform arithmetic operations on non-numeric elements.