| validateColumn | R Documentation |
Validate whether a variable points to a certain existing column in a table.
validateColumn(
column,
x,
type = c("character", "date", "logical", "numeric", "integer"),
validation = "error",
null = FALSE,
empty = TRUE,
nm = deparse1(substitute(column), backtick = TRUE),
call = parent.frame()
)
column |
Name of a column that you want to check exists in |
x |
Table to check if the column exists. |
type |
Type of the column. |
validation |
How to perform validation: "error", "warning". |
null |
Whether |
empty |
Whether it can be empty. |
nm |
Name to use in error messages. Defaults to the expression supplied
to |
call |
Call argument passed to |
the validated name
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.