View source: R/assert_no_globals.R
assert_no_globals | R Documentation |
This function will stop code execution with an error if the function passed in uses a global variable.
assert_no_globals(test_function, name = deparse1(substitute(test_function)))
test_function |
function to check for global variables |
name |
(optional) the name of function as a string – passed to the error message |
nothing
## Not run: broken_function <- function() print(y) assert_no_globals(broken_function) assert_no_globals(broken_function, name = "the_name_of_my_function") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.