View source: R/forestsearch_helpers.R
| filter_valid_args | R Documentation |
Given a named list of user-supplied parameters and a target function,
returns only the parameter entries whose names appear in the target's
formals. Entries with names that do not match any
formal (typos, renamed parameters, parameters from a different function)
are either silently dropped (default) or reported via warning().
filter_valid_args(
params,
target_fun,
exclude = character(0),
warn_unknown = FALSE
)
params |
Named list of user-supplied parameter values. |
target_fun |
A function (not its name). Its |
exclude |
Character vector of formal-argument names to explicitly
exclude from the allowlist, even though they appear in
|
warn_unknown |
Logical. If |
This replaces the older "hand-maintained valid_pnames whitelist"
pattern in .run_fs_analysis_gen() and .run_grf_analysis_gen().
New forestsearch() or grf.subg.harm.*() arguments flow
through automatically; authors of new parameters no longer need to
update a whitelist in a separate file to make the new parameter
reachable from user-level fs_params / grf_params lists.
A named list, the subset of params whose names are in
formals(target_fun) and not in exclude.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.