At the time of writing this README, this Validate R-Package is not available on CRAN. Use devtools to either install from GitHub or Build and Install locally:
devtools::install_github("https://github.com/FlippieCoetser/Validate")
.tar.gz filedevtools::build()
.tar.gz fileinstall.packages("path_to_file/tar_gz_file", repos = NULL, type="source")
The following list of validators are available:
is.not.NULLis.data.frameis.characteris.emptyis.not.emptyhas.one.rowis.UUIDThere are two ways to access the validators:
Validator component using the package namespacelibrary(Validate)
Validator componentvalidator <- Validator()
Validator componentvalidator <- Validate::Validator()
The validator instance created below can be used to perform validation. For example, test if a variable is not null and throw an error is the variable is NULL.
variable <- NULL
is.not.NULL validator to test if the variable is not NULLresult <- variable |> validator[['is.not.NULL']]('variable')
Because the variable is NULL, an error will the thrown with the following message:
"Argument.NULL: 'variable' cannot not be NULL."