Open actualben opened 2 years ago
BTW here's an article/video from a prominent R developer (former Rstudio employee, current senior engineer at Netflix, former Bioconductor core dev) which recommends not using missing()
for this purpose https://www.jimhester.com/post/2019-04-17-missing/
Good point. If I can summarise: the default values in the catalogueExport
are never used. If not user-provided, they will be overridden by whatever is in the if-body. -edit- upon rereading; another issue is that there is no way to provide an argument (from another part of the code) that triggers the default behaviour.
If you can open a PR, that would be great. Thanks already for all the detailed info!
thanks I'll get a PR in this week
Currently the
catalogueExport
function uses the built-in R functionmissing()
to check for non-default function arguments:This is in contrast to checking the argument's value:
This makes life a bit harder for code that calls
catalogueExport
because you can't do something like this:...because no possible value of
config$analysisIds
can specify that you want the default behavior (where noanalysisIds
argument was specified).I've tried using
substitute()
to make an argument appear to be missing, but then that masks the default value ofanalysisIds
from thecatalogueExport
function definition.I can use conditionals to build up a list of function arguments and pass that via
do.call
but that makes the code a bit less clear and it fixes my problem but leaves it for other people.How would you feel about a PR that replaces
missing()
checks with value checks?The current uses of
missing()
: