Description Usage Arguments Value See Also Examples
This function checks parent frame environment for existence of names. This is meant to be used with ‘assertr'’s 'verify' function to check for the existence of specific column names in a 'data.frame' that is piped to 'verify'. It can also work on a non-'data.frame' list.
1 |
... |
A arbitrary amount of quoted names to check for |
TRUE is all names exist, FALSE if not
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | verify(mtcars, has_all_names("mpg", "wt", "qsec"))
library(magrittr) # for pipe operator
## Not run:
mtcars %>%
verify(has_all_names("mpgg")) # fails
## End(Not run)
mpgg <- "something"
mtcars %>%
verify(exists("mpgg")) # passes but big mistake
## Not run:
mtcars %>%
verify(has_all_names("mpgg")) # correctly fails
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.