Description Usage Arguments Value Examples
Checking if the length of the different elements of a list corresponds to what one expects.
1 | checkLength(listObjects, lengthObjects)
|
listObjects |
List of vectors, of irrespective data type. |
lengthObjects |
Numeric vector, either of the same length as the 'listObjects' argument, or of length 1, but in the latter case, it will be tested whether or not the length of every element of the 'listObjects' argument equal this one value. |
No value is returned if all vectors correspond to the length against which it is tested. An error message is thrown when the length does not corresponds for at least one element of the list.
1 2 3 4 5 6 7 8 9 | arg1 <- 'something'
checkLength(list(arg1), 1)
checkLength(list('somethingElse', TRUE), 1)
checkLength(list('somethingElse', TRUE), c(1, 1))
arg2 <- 2:5
checkLength(list(arg1, arg2), c(1, 4))
checkLength(list(arg1, arg2), 1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.