View source: R/26_GetFuncArgs.R
| GetFuncArgs | R Documentation |
Retrieves the arguments passed to the calling function, optionally filtering by name or returning only argument names.
GetFuncArgs(
exclude = NULL,
name_only = FALSE,
func = rlang::caller_fn(),
call = rlang::caller_call(),
dots_expand = TRUE,
envir = rlang::caller_env()
)
exclude |
A character or interger vector of argument names to exclude from the result. Default is |
name_only |
Logical. If |
func |
which function to seek |
call |
The call expression to extract arguments from. Default is |
dots_expand |
Logical. Whether to expand |
envir |
The environment in which to evaluate the call. Default is |
If name_only is TRUE, a character vector of argument names. Otherwise, a named list of arguments.
## Not run:
inner_func <- function(a, b, ...) {
GetFuncArgs(exclude = "b", name_only = TRUE)
}
inner_func(1, 2, 3, 4) # Returns c("a", "...")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.