declare | R Documentation |
Stops if variable type is wrong.
declare(..., ..env = parent.frame())
decl(x, pred)
... |
Parameters of the form name="type" or even name="type1|type2|..." |
x |
Variable to be type-checked |
pred |
A type checking predicate, such as
|
decl
is a simple, fast type checker,
and should be used when speed matters,
such as in low-level functions.
declare
is more powerful and implements
a convenient syntax for richer types.
decl
returns its first argument.
declare
returns NULL invisibly.
In any event, both functions halt on type errors.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.