import.function.header.from.src.file: Import the function header 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 (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.header.from.src.file(func, f,
    strip.comment.char = FALSE)

Arguments

func

a function name, or the function's code

f

The path to the file containing the function.

strip.comment.char

logical: if TRUE, strip the leading comment characters.

Value

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

Author(s)

Mark Cowley, 2009-10-13


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