| checks | R Documentation |
Different functions to check parameters, ids, elements and lists
.paramClass(param, cls) .checkClass(param, cls, name, cname = c()) .checkAllClass(L, cls, name, cname = c()) .checkClassOneOf(param, clss, name, cname = c()) .checkCharacter(param, name, cname = c()) .checkNumeric(param, name, cname = c()) .checkLogical(param, name, cname = c()) .checkList(param, name, cname = c()) .paramNamed(param) .checkNamed(param, name, cname = c()) .checkNamedCharacter(param, name, cname = c()) .checkNamedNumeric(param, name, cname = c()) .checkNamedLogical(param, name, cname = c()) .checkNamedList(param, name, cname = c()) .paramNonNeg(param) .checkNonNeg(param, name, cname = c()) .paramNoNa(param) .checkNoNa(param, name, cname = c()) .checkIsUniqueId(param, name, cname = c()) .checkIsId(param, name, cname = c()) .paramIsOptionalId(param, name) .checkSameLength(cname, ...) .paramAnyNotNull(name, ...) .checkAnyNotNull(name, cname = c(), ...) .elementsUnique(A) .checkUnique(A, name, cname = c()) .elementsUniqueDF(DF, cols) .checkUniqueDF(DF, cols, cname = c()) .elementsInDict(A, key) .elementsBContainsAllA(A, B) .checkBContainsAllA(A, B, name, cname = c()) .checkRefs(A, B, name, cname = c()) .checkRefPresent(A, key, cls, name, cname = c()) .listAllNumeric(L) .checkAllNumeric(L, name, cname = c()) .listAllNumericOrInDict(L, key) .checkAllNumericOrInDict(L, key, name, cname = c())
param |
some parameter. |
cls |
character; class name. |
name |
character; for logging the used name for the parameter. |
cname |
character; for logging the name of the calling function. |
L |
list. |
clss |
character vector; list of class names. |
... |
list of some vectors. |
A, B |
vectors. |
DF |
data.frame. |
cols |
column names. |
key |
name of the dictionary entry in |
The .check* functions perform a test and stop with a custom error on fail.
All other functions perform a test and return the result.
The used .DICT: looks as follows:
VPpropertiesOf: network, nodes, edges, nodes:default, edges:default
VPpropertyFields: properties, dependencies, mappings
SN: all
TCappliesTo: nodes, edges, networks
logical
.paramClass: checks if the object param is of class cls.
.checkClass: checks if the object param is of class cls.
.checkAllClass: checks if all elements of the list L are of class cls.
.checkClassOneOf: checks if param is any class of clss.
.checkCharacter: checks if param is character.
.checkNumeric: checks if param is numeric.
.checkLogical: checks if param is logical.
.checkList: checks if param is a list.
.paramNamed: checks if param has names.
.checkNamed: checks if param has names.
.checkNamedCharacter: checks if param has names and is character.
.checkNamedNumeric: checks if param has names and is numeric.
.checkNamedLogical: checks if param has names and is logical.
.checkNamedList: checks if param has names and is a list.
.paramNonNeg: checks if param is greater than 0 if not NA.
.checkNonNeg: checks if param is greater than 0 if not NA.
.paramNoNa: checks if param is not NA.
.checkNoNa: checks if param is not NA.
.checkIsUniqueId: checks if param is an unique id.
.checkIsId: checks if param is an id.
.paramIsOptionalId: checks if param is an optional id.
.checkSameLength: checks if all elements in ... have the same number of elements.
.paramAnyNotNull: checks if any element in ... is not NULL.
.checkAnyNotNull: checks if any element in ... is not NULL.
.elementsUnique: checks if the elements in A are unique.
.checkUnique: checks if the elements in A are unique.
.elementsUniqueDF: checks if the elements in the columns cols of DF are unique.
.checkUniqueDF: checks if the elements in the columns cols of DF are unique.
.elementsInDict: checks if the elements of A are in .DICT[[key]].
.elementsBContainsAllA: checks if all elements of A are present in B.
.checkBContainsAllA: checks if all elements of A are present in B.
.checkRefs: checks if B contains all elements of A, aka. references.
.checkRefPresent: checks if a referred aspect of class cls is accessible by key in A.
.listAllNumeric: checks if all elements of a list L are numeric.
.checkAllNumeric: checks if all elements of a list L are numeric.
.listAllNumericOrInDict: checks if all elements of a list L are numeric or in .DICT[[key]].
.checkAllNumericOrInDict: checks if all elements of a list L are numeric or in .DICT[[key]].
Internal function only for convenience
NULL
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.