Assert a vector meets important data-quality requirements.

assert_non_na(x, class_vector, proportion_minimum)
assert_non_na_and_unique(x, class_vector)

Arguments

x

Vector to inspect. Required.

class_vector

The required base::class() of the vector. If the parameter is missing, the object's class is not checked.

proportion_minimum

The (inclusive) minimum proportion of the vector's elements that should meet the requirement. If missing, all elements must pass.

Examples

requireNamespace("OuhscMunge")
OuhscMunge::assert_non_na(1:30, "integer")
if (FALSE) {
OuhscMunge::assert_non_na(c(1:30, NA_integer_), "integer")
}