search for: my_option2

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

Did you mean: my_options
2024 Mar 29
1
declare and validate options
...x, 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 is set AND the namespace is already loaded (s...
2024 Mar 29
1
declare and validate options
...esign : > > 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 is set AND the...
2024 Mar 29
1
declare and validate options
...ave 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 occ...