3 ms·
as.logical(2) being TRUE is perplexing only if you interpreted 2 == TRUE as as.logical(2)==TRUE rather than as 2==as.integer(TRUE) [Edit: "If the two argu
by kgwgk 4y ago
as.logical(2) being TRUE is perplexing only if you interpreted
2 == TRUE
as
as.logical(2)==TRUE
rather than as
2==as.integer(TRUE)
[Edit: "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."]