Skip to contents

Assign Argument Default Values in the Global Environment

Usage

assignArgumentDefaults(FUN)

Arguments

FUN

a function (a closure or a primitive). If FUN is a character string then the function with that name is found and used.

Examples

# Assign the default values of breakInSequence() in the global environment
assignArgumentDefaults(kwb.utils::breakInSequence)

# The argument "expectedDiff" is now in the global environment
ls()
#> character(0)

# Its value is 1 which is the default value defined in the function definition
expectedDiff
#> [1] 1