search for: my_option1

Displaying 3 results from an estimated 3 matches for "my_option1".

Did you mean: my_options
2024 Mar 29
1
declare and validate options
...r and that it's not necessarily so complex, here's a draft of possible design : We could have something like this in a package to register options along with an optional validator, triggered on `options(..)` (or a new function). # similar to registerS3method() : registerOption("mypkg.my_option1") registerOption("mypkg.my_option2", function(x) stopifnot(is.numeric(x)) # maybe a `default` arg too to avoid the .onLoad() gymnastics and invisible NULL options * validation is a breaking change so we'd have an environment variable to opt in * validation occurs when an option...
2024 Mar 29
1
declare and validate options
...so complex, > here's a draft of possible design : > > We could have something like this in a package to register options along > with an optional validator, triggered on `options(..)` (or a new function). > > # similar to registerS3method() : > registerOption("mypkg.my_option1") > registerOption("mypkg.my_option2", function(x) stopifnot(is.numeric(x)) > # maybe a `default` arg too to avoid the .onLoad() gymnastics and invisible > NULL options > > * validation is a breaking change so we'd have an environment variable to > opt in >...
2024 Mar 29
1
declare and validate options
...aft of possible design : > > > > We could have something like this in a package to register options along > > with an optional validator, triggered on `options(..)` (or a new > function). > > > > # similar to registerS3method() : > > registerOption("mypkg.my_option1") > > registerOption("mypkg.my_option2", function(x) stopifnot(is.numeric(x)) > > # maybe a `default` arg too to avoid the .onLoad() gymnastics and > invisible > > NULL options > > > > * validation is a breaking change so we'd have an environment...