# If you're new to check_arg, given the many types available,
# it's very common to make mistakes when creating check_arg calls.
# The developer mode ensures that any problematic call is spotted
# and the problem is clearly stated
#
# Note that since this mode ensures a detailed cheking of the call
# it is thus a strain on performance and should be always turned off
# otherwise needed.
#
# Setting the developer mode on:
setDreamerr_dev.mode(TRUE)
# Creating some 'wrong' calls => the problem is pinpointed
test = function(x) check_arg(x, "integer scalar", "numeric vector")
try(test())
test = function(...) check_arg("numeric vector", ...)
try(test())
test = function(x) check_arg(x$a, "numeric vector")
try(test())
test = function(x) check_arg(x, "numeric vector integer")
try(test())
test = function(x) check_arg(x, "vector len(,)")
try(test())
# etc...
# Setting the developer mode off:
setDreamerr_dev.mode(FALSE)
Run the code above in your browser using DataLab