In R for Everyone by Jared P. Lander on p. 54 it says "...NULL is atomical and cannot exist within a vector. If used inside a vector, it simply disappears."
I understand the concept of being atomic is being indivisible and that NULL represents "nothingness", used commonly to handle returns that are undefined.
Therefore, is NULL atomical b/c it has this one value always of "nothingness", meaning something simply does not exist and therefore R's way of handling that is to just not let it exist in a vector or on assignment in a list it will actually remove that element?
Trying to wrap my head around it and find a more intuitive and comprehensive answer.
Let me come back to this "old" Q. I'm a (founding) R-core member and for us "atomic vector" is an important concept we've used in many places in both documentation and also the source code of R itself, both on the R and C level.
Your Q is very good: Currently, it is the case that is.atomic(NULL)
returns TRUE in R, but we have several times discussed that this may be intuitive to some ({"NULL being the smallest object in R at all, you should treat it as an atom"}),
but is really in contradiction to how we have defined "atomic vector"s in many places, and also how the C-level internal isVectorAtomic() is defined and used: an atomic vector in that sense must be of one of the 6 atomic vector types: { logical, integer, double, complex, character, raw }.
Currently I am working towards changing is.atomic() with the plan that a future release of R will have is.atomic(NULL) to become FALSE.
This is not a promise, but the declaration of an intent.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With