validateStrataArgument: To validate a strata list. It makes sure that elements are...

View source: R/validate.R

validateStrataArgumentR Documentation

To validate a strata list. It makes sure that elements are unique and point to columns in table.

Description

To validate a strata list. It makes sure that elements are unique and point to columns in table.

Usage

validateStrataArgument(
  strata,
  table,
  empty = TRUE,
  nm = deparse1(substitute(strata), backtick = TRUE),
  call = parent.frame()
)

Arguments

strata

A list of characters that point to columns in table.

table

A table with columns.

empty

Whether it can be empty.

nm

Name to use in error messages. Defaults to the expression supplied to strata.

call

Call argument passed to cli functions.

Value

The same strata input or an error if the input is incorrect.

Examples

strata <- list("age", "sex", c("age", "sex"))
x <- dplyr::tibble(age = 30L, sex = "Female")

validateStrataArgument(strata, x)


omopgenerics documentation built on June 17, 2026, 5:07 p.m.