Description Usage Arguments Value Examples
Currently the docstring must come first and the metadata list must come second. Both must precede any other code in the function. These constraints may be relaxed in the future.
1 | extract_metadata(expr, env = parent.frame(), skip_name = TRUE)
|
expr |
an expression with an optional docstring as the first statement |
env |
Environment in which to search for functions |
skip_name |
Do not attempt to find function matching expressions of
type 'name'. If FALSE, then a function will by searched for with name
|
a list of three elements, the expression with the docstring and metadata removed, the docstring itself, and the metadata.
1 2 3 4 5 6 7 8 9 | ## extract metadata from a block
expr <- substitute(
{
"this is the docstring"
list(foo="this is meta data")
5 * 32
}
)
extract_metadata(expr)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.