Closed mb706 closed 3 years ago
I struggle with this, too. There are times that I want to:
logical(0)
)NULL
(i.e. null.ok = FALSE
)any.missing = FALSE
and all.missing = FALSE
, since both c(TRUE, NA)
and c(NA, NA)
should fail.So, for typed vectors, effectively something like empty.ok = TRUE
.
I've improved the documentation as suggested by @mb706. AFAICT the use case of @mmuurr seems to be rather unusual, so I guess introducing a new argument for this is not justified. I believe you could solve this by simply doing 2 assertions?
The documentation / error message for
all.missing
is maybe a bit ambiguous, since the empty vector does not contain any missing values. Maybe rephrase this tono non-missing values
, and clarify the documentation that empty vectors are not accepted?