Try it:
"hello" > 0
I tried using as.numeric("hello") but it just gave me back NA. What gives?
as.numeric("hello")
NA
Because 0 is coerced to "0". See help(">"):
0
"0"
help(">")
If the two arguments are atomic vectors of different types, one is coerced to the type of the other, the (decreasing) order of precedence being character, complex, numeric, integer, logical and raw.
548k questions
547k answers
4 comments
86.3k users