Description Usage Arguments Details
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.
1 | formalArgs(def)
|
def |
Either a function, or a character naming a function |
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.