This will return true on the following conditions:
The object inside __entry__ has NAs
The object inside __entry__ is a single NA.
I want behaviour 2, not 1.
Possible fixes:
all(is.na(__target__$__entry__[[1]]))
is.na(__target__$__entry__)
The all option is reliable about returning a single bool.
is.na is slightly unreliable about when it applies to just a top
level value, and when it drills down into the whole object. A vector,
a data.frame and a list of vectors are all vectorised, but a list of
data.frames or lists are not vectorised, and the inner list returns
false.
Go with all.
I will implement this after I have verified the plotting functions, because the change will trigger a rebuild of the whole pipeline.
Currently the typical check is
any(is.na(__target__$__entry__[[1]]))
This will return true on the following conditions:
__entry__
has NAs__entry__
is a single NA.I want behaviour 2, not 1.
Possible fixes:
all(is.na(__target__$__entry__[[1]]))
is.na(__target__$__entry__)
The
all
option is reliable about returning a single bool.is.na
is slightly unreliable about when it applies to just a top level value, and when it drills down into the whole object. A vector, a data.frame and a list of vectors are all vectorised, but a list of data.frames or lists are not vectorised, and the inner list returns false.Go with
all
.I will implement this after I have verified the plotting functions, because the change will trigger a rebuild of the whole pipeline.