check_ages_over_90: Check for ages over 90

Description Usage Arguments Value Examples

View source: R/check-ages-over-90.R

Description

Checks metadata for ages over ninety that should be censored.

Usage

1
2
3
4
5
6
7
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

1
2
3
4
5
6
dat <- data.frame(ageDeath = c(65, 80, 95))
check_ages_over_90(dat)

# Can check multiple columns
dat <- data.frame(age1 = c(50, 55), age2 = c(90, 95))
check_ages_over_90(dat)

dccvalidator documentation built on July 2, 2020, 4:05 a.m.