expect_colnames

DataFrame column names assertion

Passes if the DataFrame column names match the given list of strings exactly (order-sensitive).

Parameters

Returns

Expect_pass when names match; Expect_hold on NA; Expect_stop on errors or mismatch.

Examples

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

See Also

expect_fields, expect_has_colnames, expect_ncol, expect_nrow