has_class {assertr} | R Documentation |
This is meant to be used with ‘assertr'’s 'verify' function to check for the existence of a specific column class in a 'data.frame' that is piped to 'verify'.
has_class(..., class)
... |
An arbitrary amount of quoted column names to check for |
class |
Expected class for chosen columns. |
TRUE if all classes are correct, FALSE if not
verify(mtcars, has_class("mpg", "wt", class = "numeric"))
library(magrittr) # for pipe operator
## Not run:
mtcars %>%
verify(has_class("mpg", class = "character")) # fails
## End(Not run)