match_call: Match Call Arguments to Parameters

View source: R/match_call.R

match_callR Documentation

Match Call Arguments to Parameters

Description

This function matches the arguments in an unevaluated call to the parameters in a function definition.

Usage

match_call(node, definition, expand_dots, envir)

## S3 method for class 'call'
match_call(node, definition = find_function(node, envir),
  expand_dots = TRUE, envir = parent.frame())

## S3 method for class 'Call'
match_call(node, definition = find_function(node, envir),
  expand_dots = TRUE, envir = parent.frame())

Arguments

node

An unevaluated call with arguments to match.

definition

Optional definition for the called function.

expand_dots

(logical) Should arguments matching ... in the call be expanded or left as a ... argument?

envir

(environment) An environment where find_function() can look up function definition. Only used if definition is missing.

Details

This function is a wrapper for match.call() that adds support for:

  • Primitive functions

  • Anonymous functions

  • Automatic definition lookup based on the call

  • ASTNode objects as the call or the defintion

Value

An object of the same class as node, with full parameter names for all arguments.

See Also

match.call(), find_function()


nick-ulle/rstatic documentation built on May 14, 2024, 8:10 p.m.