check | R Documentation |
check
is a generic function that tests the validity of a given
object.
check(object, ...)
object |
an object to be tested for validity. |
... |
further arguments to be passed to the particular dispatched function. |
check
tests if a given object meets the formal requirements of
being a valid object of its class. If the test fails, additional
warnings should be provided, giving some information why the test failed.
returns TRUE
if object
passes the validity test for the
specific class and FALSE
otherwise.
R's dispatching mechanism determines the class of a given object
and then calls the function check.<class-name>
. If no specific
check
function is found, check.default
is called. The
function check.default
does not make much sense, for the
purpose of check
is to test the validity for a specific
class. Hence, check.default
simply returns FALSE
together with a warning message that no specific
check.<class-name>
function was found.
The dispatching mechanism has immediately two consequences:
a class specific check
routine need not to check
whether the object belongs to the class itself, because if it would
not, the function would not have been called.
if no specific check
routine is found, the result for a
call of check
will be FALSE
, since in this case the
default function is called which will return FALSE
in any case.
Thorn Thaler
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.