Here are a part of my data
df <- data.frame(
Group1 = rep(c('A', 'A'), 50),
Group2 = rep(c('A', 'B'), 50),
Group3 = rep(c('A', 'B'), 50),
Value1 = rnorm(50,12,4),
Value2 = rnorm (50,10,4),
Value3 = rnorm (50,10,4)
)
Group1 corresponds to value1, Group2 corresponds to Value2 and Group3 corresponds to Value 3. I want to use the t.test to get a table ( not a list) for means and p-values for each group using Purrr.
I have used the following codes using purrr.
df %>%
split.default(rep_len(1:3, ncol(.))) %>%
pmap(~t.test(.x,.y))