Validation - If object is of prototype
assert_ptype.RdThis function wraps is_ptype() and aborts with a custom message if the
check fails. It is useful for testing function arguments.
Arguments
- ptype
[
any] The prototype to check against. Seeis_ptype()for details on what is a prototype.- ...
[
anyeach] Objects to check.- args_ptype
[
list()] Additional arguments to pass tois_ptype().- msg
[
character(1)|NULL] The message to use if the check fails. IfNULL, a default message is generated.- x_names
[
character()|NULL] The names of...to print in messages. IfNULL, the name is inferred from...'s expressions.- env
[
environment()|call()|NULL|missing_arg()] The call to inform as the origin of the error, passed torlang::abort():An environment in the call stack or a hard-coded defused call.
NULLfor no information.missing_arg()to use the assert function itself.The default is
caller_env(), to display the function where the assertion was called.
- args_cnd
[
list()] Additional arguments passed tocli::cli_abort().