NULL == 1 returns logical(0)
Clash 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)
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.
Because
length(NULL)
returns zero. To test aNULL
useis.null
, as inis.null(1)
.– Rui Barradas
Aug 13 at 8:27