# NOT RUN {
assert_values(CO2, colnames="uptake", test="gt", 0) # Are all values greater than 0?
assert_values(CO2, colnames="conc", test="lte", 1000) # Are all values less than/equal to 1000?
# }
# NOT RUN {
assert_values(CO2, colnames="uptake", test="lt", 40) # Are all values less than 40?
# Fails: not all values < 40.
# }
# NOT RUN {
assert_values(CO2, colnames="Treatment", test="in", test_val = c("nonchilled","chilled"))
CO2_mult <- CO2
CO2_mult$new_uptake <- CO2_mult$uptake * 2
assert_values(CO2, colnames="uptake", test="equal", CO2_mult$new_uptake/2)
# }
# NOT RUN {
assert_values(CO2, colnames="uptake", test="gt", CO2_mult$new_uptake/2, display_rows=F)
# Fails: uptake !> new_uptake/2
# }
Run the code above in your browser using DataLab