Description Usage Arguments Value Examples
appends all ellipses or dots arguments to code at specified location, reconstructing code to initialize variables in the code block.
1 | append_declaration(x, ..., after = length(x), dots = list())
|
x |
code block to append to |
... |
a named list of variables to create declarations for. currently only objects of a subset of types get instantiated:
|
after |
position at which to insert declaration code |
dots |
alternative passing of ellipses arguments |
reconstructed code with declarations inserted
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ## Not run:
# for example purposes, we can disable checcking of a running shiny instance
# as a safeguard against calling `reactiveValuesToList` outside of shiny
options(scirptgloss.testmode = TRUE)
code <- quote({
a <- tolower(a)
b <- b[[1]]
c <- tolower(c)
print(sprintf('this is %s %dst %s', a, b, c))
})
scriptgloss:::append_declaration(as.list(code)[-1],
a = 'my',
b = list(1,2,3),
c = 'example', after = 0)
options(scirptgloss.testmode = FALSE) # reset to default behavior
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.