Closed sgibb closed 11 months ago
IMO the following would make sense:
containsElements("H2O", NA)
should return NA
substractElement("H2O", NA)
returns NA_character_
containsElements("H2O", "")
should return FALSE
(same as e.g. containsElements("H2O", "Z")
)
with the current PR you're also reporting TRUE
for containsElements("H2O", "Z")
... thus, it always returns TRUE
even if the provided element does not exist...
containsElements("H2O", NA)
should returnNA
substractElement("H2O", NA)
returnsNA_character_
done!
containsElements("H2O", "")
should returnFALSE
(same as e.g.containsElements("H2O", "Z")
) with the current PR you're also reportingTRUE
forcontainsElements("H2O", "Z")
... thus, it always returnsTRUE
even if the provided element does not exist...
This wasn't introduced by this PR but is a bug that was/is already present. I add an issue #63 .
IMHO we could close #61 with this PR and fix #63 in another one.
This PR allows
NA
s insubtractElements
andaddElements
by handlingNA
s incountElements
(problem described in #61 )subtractElements("H2O", NA)
returns"H2O"
. Or should it returnNA
?Unfortunately it introduce a strange behaviour for
containsElements
:IMHO
containsElements("H2O", NA)
should returnFALSE
orNA
.@jorainer, @michaelwitting any suggestion for the expected behaviour?