NULL == 1 returns logical(0)

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



NULL == 1 returns logical(0)



Why does NULL == 1 returns logical(0) instead of FALSE?


NULL == 1


logical(0)


FALSE



identical(1, NULL) returns FALSE, which is correct.


identical(1, NULL)


FALSE



I know that == and identical cannot be used interchangeably, but what goes behind NULL == 1 returning logical(0)?


==


identical


NULL == 1


logical(0)





Because length(NULL) returns zero. To test a NULL use is.null, as in is.null(1).
– Rui Barradas
Aug 13 at 8:27


length(NULL)


NULL


is.null


is.null(1)





More info in this SO post
– phiver
Aug 13 at 8:38









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard