Inspired by this question, Get `chisq.test()$p.value` for several groups using `dplyr::group_by()` I am doing Chi-squared tests over a few groups but I need to customize the default chisq.test arguments but I got an error. Please see how I could improve my code. Thank you
data%>%
group_by(col4,col5)%>%
do(broom::tidy(chisq.test(x=(.$col1, .$col2),simulate.p.value = T)))
It seems to me that multiple arguments are not allowed. The error I got was
Error: unexpected ',' in:
" group_by(col4,col5)%>%
do(broom::tidy(chisq.test(x=(.$col1,"
The default works fine.
data%>%
group_by(col4,col5)%>%
do(broom::tidy(chisq.test(.$col1, .$col2)))