powered by
Validate a new column of a table
validateNewColumn( table, column, empty = TRUE, validation = "warning", nm = deparse1(substitute(column), backtick = TRUE), call = parent.frame() )
table without conflicting columns.
The table to check if the column already exists.
Character vector with the name(s) of the new column(s).
Whether it can be empty.
How to perform validation: "error", "warning".
Name to use in error messages. Defaults to the expression supplied to column.
column
Call argument passed to cli functions.
cli
x <- dplyr::tibble( column1 = c(1L, 2L), column2 = c("a", "b") ) validateNewColumn(x, "not_exiting_column") validateNewColumn(x, "column1")
Run the code above in your browser using DataLab