Functions for checking inputs and data structures
in the dem
packages, eg demarray.
End users would not normally call these functions directly.
Reduce boilerplate code, and give same – hopefully high quality – error messages across all packages.
Try to provide data that can help with debugging.
Has idea of 'scalar'. Not really part of R - scalar is just a vector of length 1 - but often useful, and gives better error messages.
Functions starting with chk_is_
or err_is_
are checking for
class or type, loosely defined.
When x
passes the test,
chk
and err
functions both
return TRUE
. When x
fails the test,
chk
functions return a string describing the failure,
and err
functions raise an error with that string
as the error message.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.