# Numeric data
test_hypothesis(mtcars$mpg, as.factor(mtcars$gear))
# Logical data
test_hypothesis(as.logical(mtcars$vs), as.factor(mtcars$gear))
# Factor data
test_hypothesis(as.factor(mtcars$carb), as.factor(mtcars$gear))
Run the code above in your browser using DataLab