NA is a boolean?

Issue #8 resolved
richelbilderbeek created an issue

Boy, did I enjoy finding this package! I felt stupid when writing my own version of is_a_bool (https://github.com/ropensci/beautier/blob/master/R/is_one_bool.R#L15) and was relieved to call assertive instead of maintaining my handcrafted functions.

A showstopper to do so, however, is this:

assertive::assert_is_a_bool(NA)

I expect a boolean to be either TRUE or FALSE; NA is not among the set of valid booleans. Yet, I see in the documentation that classifying an NA as a Boolean appears to be intentional.

Is it the intention to classify NA as a boolean?

  • If yes, I hope the reasoning for this will be added to the documentation. I will -sadly- have to use my own version of is_a_bool :-(
  • If no, I hope NA will be classified as not being a boolean and I can look forward to use assertive’s next version

Whatever the case, I am happy to see this package exists. Keep up the good work 👍

Comments (3)

  1. Log in to comment