# Load data
#:::::::::::::::::::::::::::::::::::::::
data("ToothGrowth")
df <- ToothGrowth
# Kruskal-wallis rank sum test
#:::::::::::::::::::::::::::::::::::::::::
df %>% kruskal_test(len ~ dose)
# Grouped data
df %>%
group_by(supp) %>%
kruskal_test(len ~ dose)
Run the code above in your browser using DataLab