Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

match.call.defaults

Argument matching with defaults


Description

This is a version of match.call which also includes default arguments.

Usage

match.call.defaults(definition = sys.function(sys.parent()),
  call = sys.call(sys.parent()), expand.dots = TRUE,
  envir = parent.frame(2L))

Arguments

definition

a function, by default the function from which match.call is called. See details.

call

an unevaluated call to the function specified by definition, as generated by call.

expand.dots

ogical. Should arguments matching ... in the call be included or left as a ... argument?

envir

an environment, from which the ... in call are retrieved, if any.

Value

An object of class call.

Author(s)

Neal Fultz

References

Examples

foo <- function(x=NULL,y=NULL,z=4, dots=TRUE, ...) {
  match.call.defaults(expand.dots=dots)
}

foo(4,nugan='hand')
foo(dots=FALSE,who='ami')

stackoverflow

Stack Overflow's Greatest Hits

v0.7.0
CC BY-SA 4.0
Authors
Neal Fultz <nfultz@gmail.com> and the StackOverflow.com community
Initial release
2020-01-03

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.