match_calls | R Documentation |
Recursively match calls and modify arguments
match_calls(
call,
recursive = TRUE,
replace_args = list(),
quoted = FALSE,
envir = parent.frame(),
...
)
call |
an |
recursive |
logical, recursively match calls, default is true |
replace_args |
named list of functions, see examples |
quoted |
logical, is |
envir |
which environment should call be evaluated |
... |
other parameters passing to |
A nested call with all arguments matched
library(dipsaus); library(shiny)
# In shiny modules, we might want to add ns() to inputIds
# In this example, textInput(id) will become textInput(ns(id))
match_calls(lapply(1:20, function(i){
textInput(paste('id_', i), paste('Label ', i))
}), replace_args = list(
inputId = function(arg, call){ as.call(list(quote(ns), arg)) }
))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.