Skip to content
Prev 198790 / 398506 Next

unusual result with "any"

Erin Hodgess schrieb:
xy > 1 should return TRUE FALSE, and you want to apply any() to that. 
Thus: any(xy > 1)
any(xy) returns TRUE, as the nonzero numbers are coerced to TRUE
When TRUE is compared with 1, it is coerced to a number (no warning is 
issued here), namely 1.
1 > 1 returns FALSE.