# NOT RUN {
slack_df <- data_frame(x = 0:100)
slack_new_data <- data_frame(x = -10:110)
# this will fail the check both ends
# }
# NOT RUN {
recipe(slack_df) %>%
check_range(x) %>%
prep() %>%
bake(slack_new_data)
# }
# NOT RUN {
# this will fail the check only at the upper end
# }
# NOT RUN {
recipe(slack_df) %>%
check_range(x, slack_prop = c(0.1, 0.05)) %>%
prep() %>%
bake(slack_new_data)
# }
# NOT RUN {
# give a warning instead of an error
# }
# NOT RUN {
recipe(slack_df) %>%
check_range(x, warn = TRUE) %>%
prep() %>%
bake(slack_new_data)
# }
Run the code above in your browser using DataLab