r-lib / rlang

Low-level API for programming with R
https://rlang.r-lib.org
Other
498 stars 136 forks source link

Add `min_length` to `check_character()` #1734

Open olivroy opened 1 month ago

olivroy commented 1 month ago

Sometimes you want something non-empty. allow_zero = FALSE will disallow character(0). Addresses https://github.com/r-lib/rlang/issues/1618#issuecomment-2127898009

olivroy commented 1 month ago

I agree. However allow_empty would be confusing since for check_string(). allow_empty = FALSE is meant to disallow "".

I like the length argument. maybe min_length would be good?

the proposed scalar option would be redundant since check_string() is already there.