load_defaults: Load default parameter values of a function, list of...

Description Usage Arguments Examples

View source: R/load_defaults.r

Description

Load default parameter values of a function, list of functions or all functions in a package.

Usage

1
load_defaults(fxn, pkg = NULL, path = NULL, envir = .GlobalEnv)

Arguments

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

Examples

 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)

sckott/sacbox documentation built on May 26, 2017, 3:47 a.m.