InDots: Is a Specific Argument in the Dots-Arguments?

View source: R/DescTools.r

InDotsR Documentation

Is a Specific Argument in the Dots-Arguments?

Description

Returns the value of a specific named argument if it was comprised in the dots or a default value, if it wasn't.

Usage

InDots(..., arg, default)

Arguments

...

the dots arguments to be checked.

arg

the name of argument to test for.

default

the default value to return, if the argument arg does not exist in the dots.

Value

the value of the argument, if it exists else the specified default value.

Author(s)

Andri Signorell <andri@signorell.net>

Examples

# Function returns the argument A, if supplied or 999
foobar <-  function(...){
  DescTools::InDots(..., arg="A", default=99)  
}    

foobar(A=5)
foobar(B=5, C=8)

AndriSignorell/DescTools documentation built on Dec. 1, 2024, 5:13 a.m.