validateNewColumn: Validate a new column of a table

View source: R/validate.R

validateNewColumnR Documentation

Validate a new column of a table

Description

Validate a new column of a table

Usage

validateNewColumn(
  table,
  column,
  empty = TRUE,
  validation = "warning",
  nm = deparse1(substitute(column), backtick = TRUE),
  call = parent.frame()
)

Arguments

table

The table to check if the column already exists.

column

Character vector with the name(s) of the new column(s).

empty

Whether it can be empty.

validation

How to perform validation: "error", "warning".

nm

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

call

Call argument passed to cli functions.

Value

table without conflicting columns.

Examples

x <- dplyr::tibble(
  column1 = c(1L, 2L),
  column2 = c("a", "b")
)
validateNewColumn(x, "not_exiting_column")
validateNewColumn(x, "column1")


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