Last data update: 2014.03.03

R: Expectation: does a vector have the specified length?
expect_lengthR Documentation

Expectation: does a vector have the specified length?

Description

Expectation: does a vector have the specified length?

Usage

expect_length(object, n)

Arguments

object

object to test

n

Expected length.

See Also

Other expectations: comparison-expectations, equality-expectations, expect_equal_to_reference, expect_match, expect_named, inheritance-expectations, logical-expectations, output-expectations

Examples

expect_length(1, 1)
expect_length(1:10, 10)

## Not run: 
expect_length(1:10, 1)

## End(Not run)

Results