Description Usage Arguments Value Author(s)
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.
1 2 3 4 | import.function.header(func,
src.root = getOption("src.root"), src.files = NULL,
strip.comment.char = FALSE,
exclude.patterns = c("~", ".Rcheck", ".git", ".svn"))
|
func |
a function name, or the function's code |
src.root |
The parent folder of source code |
src.files |
an optional vector of filenames to search within |
strip.comment.char |
logical: if TRUE, strip the leading comment characters. |
exclude.patterns |
vector of patterns passed to grep for files to exclude |
This code extracts the src code, and the header, or returns ""
Mark Cowley, 2009-10-13
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.