Checks metadata for ages over ninety that should be censored.

check_ages_over_90(
  data,
  col = "ageDeath",
  strict = FALSE,
  success_msg = "No ages over 90 detected",
  fail_msg = "Ages over 90 detected in the data"
)

Arguments

data

Data to check

col

Name of age column(s). Defaults to ageDeath.

strict

If FALSE, return a "check_warn" object; if TRUE, return a "check_fail" object

success_msg

Message indicating the check succeeded.

fail_msg

Message indicating the check failed.

Value

A condition object indicating whether the data contains ages over ninety.

Examples

dat <- data.frame(ageDeath = c(65, 80, 95)) check_ages_over_90(dat)
#> <check_warn: Ages over 90 detected in the data>
# Can check multiple columns dat <- data.frame(age1 = c(50, 55), age2 = c(90, 95)) check_ages_over_90(dat)
#> <check_pass: No ages over 90 detected>