Description Usage Arguments Value Examples
Insert quoted insertions at the start of a function body (after the opening of the function).
1 | body_insert(fn_body, insertion, before = NULL)
|
fn_body |
The body of a function (as found via body(fun)). |
insertion |
A quoted expression to add at the beginning of the function. |
A function body with the insertion. Note: If before is specified and is not found anywhere in fn_body, fn_body is returned unaltered.
1 2 3 4 | fun <- function(x) {
x + 1
}
body_insert(body(fun), quote(x + 2))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.