mllg / checkmate

Fast and versatile argument checks
https://mllg.github.io/checkmate/
Other
261 stars 30 forks source link

argument fixed being not a logical mislead me #206

Closed SamGG closed 3 years ago

SamGG commented 3 years ago

Hi, I have just started using checkmate, which is incredibly concise. I was mislead by the fixed argument which is a string in checkmate whereas it is a logical in standard. I am wondering if you could consider that when fixed is a logical the searched pattern is pattern not fixed. I think this would change slightly the order of the blocks at https://github.com/mllg/checkmate/blob/434a2cf36020c4fd8eac37b5c50b77e7e28822cc/R/checkCharacter.R#L34-L50 Best, Samuel

mllg commented 3 years ago

You are right, this is misleading if you are used to grep(). Unfortunately, changing the API after release is really difficult without breaking packages. You should get an informative error message, though.