I often want to do a set of checks on the columns of data.frames before doing checks on the values within each column itself.
For example, I want to check that all columns are present, and rather than use the has_names() function with verify(), I'd like the output to specify what column or columns are missing. Similarly, I use verify(is.numeric(numeric_column_1)) %>% verify(is.numeric(numeric_column_2)) when a cleaner report would look more like assert(is.numeric, numeric_column_1, numeric_column_2).
What would you think about an assert_cols() function?
I often want to do a set of checks on the columns of data.frames before doing checks on the values within each column itself.
For example, I want to check that all columns are present, and rather than use the
has_names()function withverify(), I'd like the output to specify what column or columns are missing. Similarly, I useverify(is.numeric(numeric_column_1)) %>% verify(is.numeric(numeric_column_2))when a cleaner report would look more likeassert(is.numeric, numeric_column_1, numeric_column_2).What would you think about an
assert_cols()function?