Skip to contents

use aliases for function arguments

Usage

alias_arg(..., default = NULL)

Arguments

...

aliases of an argument

default

a alias with a default value

Value

the finally value of this argument across all aliases

Examples


# set y, z as aliases of x when create a function
func <- function(x = 1, y = NULL, z = NULL) {
  x <- alias_arg(x, y, z, default = x)
  return(x)
}