# NOT RUN {
# Example 1: pipe-friendly t_test().
# Two possibilities of usage are available
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# Use this
ToothGrowth %>%
group_by(dose) %>%
doo(~t_test(data =., len ~ supp))
# Or this
ToothGrowth %>%
group_by(dose) %>%
doo(t_test, len ~ supp)
# Example 2: R base function t.test() (not pipe friendly)
# One possibility of usage
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
comparisons <- ToothGrowth %>%
group_by(dose) %>%
doo(~t.test(len ~ supp, data =.))
comparisons
comparisons$.results.
# Example 3: R base function combined with tidy()
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ToothGrowth %>%
group_by(dose) %>%
doo(~t.test(len ~ supp, data =.) %>% tidy())
# }
Run the code above in your browser using DataLab