# install.packages("devtools")
devtools::install_github("shunsambongi/chex")
check_that()
takes an object you want to check, and a number of checks
to run against the object. A check is usually a function that takes the
object as the first argument and returns a boolean value of whether the
check passed (TRUE
) or failed (FALSE
).
library(chex)
library(magrittr)
#> Warning: package 'magrittr' was built under R version 3.6.1
results <- mtcars %>%
check_that(
is.data.frame, # this should PASS
is.character, # this should FAIL
)
print(results)
#> -- RESULTS ------------------------------------------------- [2] --
#> v PASS ... is.data.frame
#> x FAIL ... is.character