| checkEnvironment {checkmate} | R Documentation |
Check if an argument is an environment
checkEnvironment(x, contains = character(0L)) assertEnvironment(x, contains = character(0L), .var.name) testEnvironment(x, contains = character(0L))
x |
[any] |
contains |
[ |
.var.name |
[character(1)] |
Depending on the function prefix:
If the check is successful, all functions return TRUE.
If the check is not successful, assertEnvironment throws an error message,
testEnvironment returns FALSE and checkEnvironment returns
a string with the error message.
Other basetypes: assertArray,
checkArray, testArray;
assertAtomicVector,
checkAtomicVector,
testAtomicVector;
assertAtomic, checkAtomic,
testAtomic; assertCharacter,
checkCharacter,
testCharacter; assertComplex,
checkComplex, testComplex;
assertDataFrame,
checkDataFrame,
testDataFrame; assertFactor,
checkFactor, testFactor;
assertFunction,
checkFunction, testFunction;
assertIntegerish,
checkIntegerish,
testIntegerish;
assertInteger, checkInteger,
testInteger; assertList,
checkList, testList;
assertLogical, checkLogical,
testLogical; assertMatrix,
checkMatrix, testMatrix;
assertNumeric, checkNumeric,
testNumeric; assertVector,
checkVector, testVector
ee = as.environment(list(a = 1)) testEnvironment(ee) testEnvironment(ee, contains = "a")