# 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)
Run the code above in your browser using DataLab