Description Usage Arguments Value See Also Examples
Since calling a function needs arguments, we should provide values explicitly to a argument without default value. Except that, we could call it interactively, i.e. we could ask user to provide value for each argument during execution of function.
1 2 3 | interactive_call(fun, quiet = FALSE, debug = FALSE)
interactive_call_(quo_fun, quiet = FALSE, debug = FALSE)
|
fun |
a function to be executed. |
quiet |
a logical of whether display interactive message. Default FALSE means display interactive message in execution. |
debug |
a logical of whether execute fun in simulation mode or real mode. Default FALSE means to execute function in real mode. |
quo_fun |
a function quoted by |
return value from fun
if debug = TRUE
, otherwise NULL.
Other utils_cliui:
help_fun()
,
interactive_fun()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | ## Not run:
# NSE examples -- Usage in interactive mode
# Call a function by prompting user to provide values for arguments
interactive_call(print)
# Call a function interactively which execute without displaying information
interactive_call(print, quiet = TRUE)
# Call a function interactively which execute it in debug mode
interactive_call(print, debug = TRUE)
# SE examples -- Usage in program mode
# Program with SE version function
inter_call <- function(fun) {
interactive_call_(rlang::quo(fun), quiet = TRUE)
}
inter_call(print)
## End(Not run)
# NSE version of function
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.