GetFuncArgs: Get Function Arguments from Calling Context

View source: R/26_GetFuncArgs.R

GetFuncArgsR Documentation

Get Function Arguments from Calling Context

Description

Retrieves the arguments passed to the calling function, optionally filtering by name or returning only argument names.

Usage

GetFuncArgs(
  exclude = NULL,
  name_only = FALSE,
  func = rlang::caller_fn(),
  call = rlang::caller_call(),
  dots_expand = TRUE,
  envir = rlang::caller_env()
)

Arguments

exclude

A character or interger vector of argument names to exclude from the result. Default is NULL.

name_only

Logical. If TRUE, returns only argument names. If FALSE, returns the full argument list. Default is FALSE.

func

which function to seek

call

The call expression to extract arguments from. Default is rlang::caller_call().

dots_expand

Logical. Whether to expand ... arguments. Default is TRUE.

envir

The environment in which to evaluate the call. Default is rlang::caller_env().

Value

If name_only is TRUE, a character vector of argument names. Otherwise, a named list of arguments.

Examples

## 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)


SigBridgeRUtils documentation built on Sept. 29, 2026, 5:09 p.m.