update_function_arguments: Change the formal arguments of a function

Description Usage Arguments Value Examples

Description

If the function is specified within a package, then update the function within the namespace of the package.

Usage

1
2
update_function_arguments(function_name, package_name = NULL,
  envir = parent.frame(), ...)

Arguments

function_name

character name of function

package_name

character name of package. Set this if you want the function to be updated within the package namespace. If this is unset then the changed function is placed in the specified environment

envir

environment to place the function if package_name not set

...

replacement formal arguments for function e.g. "na.rm=FALSE, drop=, n=10"

Value

TRUE otherwise should throw an error

Examples

1
2
3
4
5
## Not run: 
Change the default value for `mean` from `0` to `100`
update_function_arguments(function_name = 'rnorm', package_name = 'stats', mean = 100)

## End(Not run)

coolbutuseless/grrr documentation built on May 16, 2019, 7:15 p.m.