find.src.file: Find the source file for a given function.

Description Usage Arguments Value Author(s)

Description

Given a directory of R packages under development (under src.root), or a vector of R files, given by src.files, determine the name of the source file which func was defined within.

Usage

1
2
3
4
  find.src.file(func, src.root = getOption("src.root"),
    src.files = NULL,
    exclude.patterns = c("~", ".Rcheck", ".git", ".svn"),
    unique = TRUE, exclude.symlinks = TRUE)

Arguments

func

a function name, or function's code

src.root

The parent folder of source code

src.files

an optional vector of filenames to search within

exclude.patterns

vector of patterns passed to grep for files to exclude

unique

logical: If TRUE then at most 1 file path is returned; if FALSE, all matching filepaths are returned

exclude.symlinks

logical: if TRUE, then only report files which are not symbolic links.

Value

a vector of file paths

Author(s)

Mark Cowley


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