import.function.from.src.file: Import the function definition from within a source file.

Description Usage Arguments Value Author(s)

Description

I usually write detailed comment headers before functions in source code files. scenarios: 1. function header preceded by comment block preceded by a blank line, or top of file 2. function header preceded by (blank line or top of file) -> no comment has been written.

Usage

1
2
  import.function.from.src.file(func, f,
    import.header = TRUE)

Arguments

func

a function name, or the function's body. eg plot or “plot

f

The path to the file containing the function.

import.header

search for & import the header comments. TRUE/FALSE

Value

This code extracts the src code, and the header, or returns ""

Author(s)

Mark Cowley, 2011-06-21


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