Description Usage Arguments Details Value Future Examples
checks the type, the length and the content
of some standard object.
If not correct, a message and a fatal error are issued.
NA are detected and considered as wrong or not.
When typ is 'directory' or 'file', x must be
a character containing path(s) of directories or files.
1 2 3 4 |
x |
object to be checked. |
typ |
Character vector indicating the accepted types for the object to be checked. See the code for the list of accepted types, among them 'null', 'integer', 'numeric', 'character', 'logical', 'list', 'any', 'function', 'data.frame', 'matrix','file','directory',... As indicated, 'any' implies that no check of the type is performed. |
len |
If length(len)==1, the exact length to be checked, if not must be of length two for the possible range of length(x). When -1, no check on the length is performed. |
con |
If length(con)>0, some check about the content of x is done for some of the types. More precisely for (integer, numeric): all values must belong to the interval [con[1],con[2]] and for (character), the set of possible character(1) is described by con. |
mensaje |
Some additional message to be issued before stopping in case of error. |
fatal |
what to do when discovering an inconsistency ? TRUE: this function prints the message and stops; FALSE: this function returns the message as a character. |
na.rm |
Must the NA values be removed before checking? This is implemented only for the types integer, numeric, character and logical. |
cla |
The class to which the object is supposed to belong. When NULL no check is made with respect to the class. |
speci |
Some additional specific check for some object types. The following possibilities are implemented: |
'integer' has not got the meaning in is.integer R standard function. 'null' must be understood as resulting TRUE with function void9.
When everything is OK returns a character(0). If not according to the argument fatal print an error message and stops, or just returns the message as a warning.
(i) improves the treatment of 'NA's; (ii) allows the check of forbidden values
1 2 3 4 5 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.