formalArgs: Bugfix for formalArgs(def)

Description Usage Arguments Details

Description

In the methods-package (loaded by default), formalArgs(def) uses the search path from namespace:methods, which can lead to confusing behaviour if you overwrite something, especially as formals(def) DOES use the environment of the caller.

Usage

1

Arguments

def

Either a function, or a character naming a function

Details

Example of different behaviour:
by <- function(a, b ,c) {"Bye-bye!"} formalArgs(by) # As expected, by does not have any quotes names(formals('by')) # Also works as expected methods::formalArgs('by') # Bug: by is found in the base-package formalArgs('by') # Result as expected


Dans-labs/R-package_EmilMisc documentation built on May 17, 2019, 6:07 a.m.