Closed arnaudgallou closed 3 months ago
In the end, that might be the desired behavior but maybe that could be mentioned in if_else()
(and possibly in vctrs::vec_cast_common()
) that NA
will be changed to NULL
in that case.
It is expected behavior. The "missing" type for a list is list(NULL)
, so NA
is cast to that when we compute the common type.
There's really no good place to put docs for this, as it is quite specific and not that common, but I'll add an example to vec_init()
with a list to show that the NA element for a list is NULL
See this example:
Created on 2024-08-27 with reprex v2.1.0
Is this the desired behavior? I'd expect
if_else()
to returnlist(NA)
in the first case.