powered by
Check length of an object
expect_length(current, length, info = NA_character_, ...)
[object] An R object with a length
[object]
[integer] A nonnegative integer
[integer]
[character] scalar. Optional user-defined message. Must be a single character string. Multiline comments may be separated by
[character]
Currently not used.
Other test-functions: expect_equal_to_reference(), expect_equal(), expect_match(), ignore()
expect_equal_to_reference()
expect_equal()
expect_match()
ignore()
expect_length(3:4, 2) # TRUE expect_length(2:5, 1) # FALSE
Run the code above in your browser using DataLab