poissonconsulting / chk

An R package for developers to check user-supplied function arguments
https://poissonconsulting.github.io/chk/
Other
48 stars 4 forks source link

Suggestion: add `inclusive` argument to `chk_range()` #120

Closed ngreifer closed 1 year ago

ngreifer commented 1 year ago

chk_range() and vld_range() use <= and >= to check that the values are in the range (inclusive), but users might also want an "exclusive" range check, i.e., using < and >. An example use case would be checking that a value is a proportion between 0 and 1 but neither 0 nor 1. I'm imagining this could be done with a new function or just an argument to chk_range() to toggle whether inclusive or exclusive checks are to be done. Thanks.

joethorley commented 1 year ago

thanks @ngreifer - that makes a lot of sense. I've added it to the to do list. Not sure which option we will go with at this point.

github-actions[bot] commented 2 months ago

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.