assert: Assert vector characteristics

assertR Documentation

Assert vector characteristics

Description

Assert a vector meets important data-quality requirements.

Usage

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")
## Not run: 
OuhscMunge::assert_non_na(c(1:30, NA_integer_), "integer")

## End(Not run)

OuhscBbmc/OuhscMunge documentation built on Dec. 5, 2024, 4:34 a.m.