How to use purrr's map function to perform row-wise prop.tests and add results to the dataframe?
问题 I'm trying to solve the following problem in R: I have a dataframe with two variables (number of successes, and number of total trials). # A tibble: 4 x 2 Success N <dbl> <dbl> 1 28. 40. 2 12. 40. 3 22. 40. 4 8. 40. I would like to perform a prop.test or binom.test on each row and add the resulting list to the dataframe (or certain elements of it, like the p-value and CIs). Ideally, I would like to add a third column with the p-values and the CI-range. My attempts so far were painly