get.function.dependencies2file: Determine all the dependencies of a function from a list of...

Description Usage Arguments Value Author(s) Examples

Description

If you've ever wanted to give someone a single function from within a package full of code, then you've probably forgotten a few other code functions & gone back & forth. Given a single function, this method will determine all the code dependencies. It only searches within a limited set of packages, such as those that you may have written yourself & not published yet. It will also tell you which CRAN/BioC packages need to be installed, but will ignore those packages which are automatically loaded at startup.

Usage

1
2
3
  get.function.dependencies2file(fun, file,
    packages = c(list.my.packages(src.root = getOption("src.root")), ".GlobalEnv"),
    src.files = NULL, verbose = FALSE)

Arguments

fun

either a function name, of the function's code

file

path to a file to write to

packages

vector of packages to search for dependencies in (ie packages that you probably wrote)

src.files

optional vector of R sources files to also search within. These have higher priority than code within packages.

verbose

logical: verbose output?

Value

nothing. writes a file containing source code.

Author(s)

Mark Cowley, 2011-04-07

Examples

1
2
3
4
5
6
7
## Not run: 
f <- tempfile()
get.function.dependencies2file(fun=edit.src.file, file=f)
get.function.dependencies2file(fun=edit.src.file, file=f, src.files=NULL, verbose=TRUE)
unlink(f)

## End(Not run)

drmjc/updateR documentation built on May 15, 2019, 2:41 p.m.