Description Usage Arguments Value Examples
Checking if the value of vectors (of length 1) is authorized.
1 | checkValues(listObjects, listValues)
|
listObjects |
List of vectors, of irrespective data type and each of length 1. It contains the list of variables of which one wants to test its value against a vector of valid values. This argument is obligatory. |
listValues |
List of vectors, of irrespective data type and of the same length as the 'listObjects' argument. It contains the values against which one wants to test the 'listObjects' argument. This argument is obligatory. |
No value is returned if all vectors correspond to the length against which it is tested. An error message is thrown when at least one of the elements of the 'listObjects' contains an invalid value, as stipulated by the 'listValues' argument.
1 2 3 4 5 6 7 8 9 10 11 12 13 | lossType <- 'absolute'
checkValues(list(lossType), list(c('absolute', 'quadratic')))
checkValues(list(lossType), list(c('absolute', 'quadratic'), c('test', 'test2')))
#The next error message is weird, since it does not return the real name of the listObject
#that found to be wrong.
lossType <- 'absolute55'
listObjects <- list(lossType)
listValues <- list(c('absolute', 'quadratic'))
checkValues(listObjects, listValues)
#Now it is ok...
checkValues(list(lossType), list(c('absolute', 'quadratic')))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.