Learn R Programming

validate (version 0.1.4)

check_that: Simple data validation interface

Description

Simple data validation interface

Usage

check_that(dat, ...)

Arguments

dat
an R object carrying data
...
a comma-separated set of validating expressions.

Value

Details

Creates an object of class validator and confronts it with the data. This function is easy to use in combination with the magrittr pipe operator.

Examples

Run this code
cf <- check_that(women, height>0, height/weight < 0.5)
cf
summary(cf)
barplot(cf)


# this works only after loading the 'magrittr' package
women %>% 
  check_that(height>0, height/weight < 0.5) %>%
  summary()

Run the code above in your browser using DataLab