
Last chance! 50% off unlimited learning
Sale ends in
Validate whether a variable points to a certain exiting column in a table.
validateColumn(
column,
x,
type = c("character", "date", "logical", "numeric", "integer"),
validation = "error",
call = parent.frame()
)
the validated name
Name of a column that you want to check that exist in x
table.
Table to check if the column exist.
Type of the column.
Whether to throw warning or error.
Passed to cli functions.
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")
Run the code above in your browser using DataLab