Description Usage Arguments Details Value Examples
When only a single output's code is desired, you can flatten the function body of the nullary output function into the top level of the syntax tree to clean up unnecessary compartmentalization.
1 | flatten_function_body(code, name)
|
code |
a code block to flatten |
name |
output to flatten |
With more than one output, you run the risk of introducing namespace conflicts that were otherwise handled by compartmentalizing withing functions.
code with last instance of outputs flattened into top level of syntax tree.
1 2 3 4 5 6 7 8 9 10 | codeblock <- quote({
a <- 1
b <- 2
f <- function() {
print(a)
print(b)
}
})
scriptgloss:::flatten_function_body(codeblock, "f")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.