expect_ncol

DataFrame column count assertion

Passes if the DataFrame has exactly n columns.

Parameters

Returns

Expect_pass when column count matches; Expect_hold on NA; Expect_stop on errors or mismatch.

Examples

assert(expect_ncol(to_dataframe([x: [1], y = [2]]), 2))

See Also

expect_length, expect_colnames, expect_nrow