validateColumn: Validate whether a variable points to a certain exiting...

View source: R/validate.R

validateColumnR Documentation

Validate whether a variable points to a certain exiting column in a table.

Description

Validate whether a variable points to a certain exiting column in a table.

Usage

validateColumn(
  column,
  x,
  type = c("character", "date", "logical", "numeric", "integer"),
  validation = "error",
  call = parent.frame()
)

Arguments

column

Name of a column that you want to check that exist in x table.

x

Table to check if the column exist.

type

Type of the column.

validation

Whether to throw warning or error.

call

Passed to cli functions.

Value

the validated name

Examples

x <- dplyr::tibble(a = 1, b = "xxx")

validateColumn("a", x, validation = "warning")
validateColumn("a", x, type = "character", validation = "warning")
validateColumn("a", x, type = "numeric", validation = "warning")
validateColumn("not_existing", x, type = "numeric", validation = "warning")


omopgenerics documentation built on April 3, 2025, 8:47 p.m.