setDreamerr_check | R Documentation |
This function allows to disable, or re-enable, all calls to check_arg
within any function. Useful only when running (very) large loops (>100K iter.) over small functions that use dreamerr's check_arg
.
setDreamerr_check(check = TRUE)
check |
Strict logical: either |
Laurent Berge
# Let's create a small function that returns the argument
# if it is a single character string, and throws an error
# otherwise:
test = function(x){
check_arg(x, "scalar character")
x
}
# works:
test("hey")
# error:
try(test(55))
# Now we disable argument checking
setDreamerr_check(FALSE)
# works (although it shouldn't!):
test(55)
# re-setting argument checking on:
setDreamerr_check(TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.