Had a thought about the expect_prop() API - it would be nice to make a slight change to make the cmp argument take an arbitrary function that takes the proportion meeting the check condition and indicates whether this proportion passes some test or not. This makes it more flexible and I think reads pretty nicely.
For e.g., with a little helper function, you can do nice things like this:
expect_prop(a1, chk_blank, is_gte(0.8))
Where is_gte() is a function generator:
is_gte <- function(prop) {
function(x) x >= prop
}