verify(mtcars, has_all_names("mpg", "wt", "qsec"))
library(magrittr) # for pipe operator
if (FALSE) {
mtcars %>%
verify(has_all_names("mpgg")) # fails
}
mpgg <- "something"
mtcars %>%
verify(exists("mpgg")) # passes but big mistake
if (FALSE) {
mtcars %>%
verify(has_all_names("mpgg")) # correctly fails
}
Run the code above in your browser using DataLab