vec_assert_or_null.RdAssert an argument has known prototype and/or size or is NULL
vec_assert_or_null(
x,
ptype = NULL,
size = NULL,
arg = caller_arg(x),
call = caller_env()
)A vector argument to check.
Prototype to compare against. If the prototype has a
class, its vec_ptype() is compared to that of x with
identical(). Otherwise, its typeof() is compared to that of
x with ==.
A single integer size against which to compare.
Name of argument being checked. This is used in error
messages. The label of the expression passed as x is taken as
default.
The execution environment of a currently
running function, e.g. caller_env(). The function will be
mentioned in error messages as the source of the error. See the
call argument of abort() for more information.
Either throws an error or returns x, invisibly.