Description Usage Arguments Examples
View source: R/load_defaults.r
Load default parameter values of a function, list of functions or all functions in a package.
1 | load_defaults(fxn, pkg = NULL, path = NULL, envir = .GlobalEnv)
|
fxn |
Function object, not character name of function. |
pkg |
Package name. |
path |
Path to a function. |
envir |
Environment to load default parameters in to. Default is .GlobalEnv |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Not run:
# A single function
foo <- function(x=5, y=4) x+y
load_defaults(foo)
x; y
# Many functions
foo <- function(x=5, y=4) x+y
bar <- function(a="a", b="b") c(a,b)
load_defaults(fxn=c(foo, bar))
# Function path
load_defaults(path="~/github/ropensci/rnoaa/R/noaa.r")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.