I have data that looks like this;
df <- data.frame(Treat = rep(LETTERS[1:4], 100, replace = TRUE),
A = rnorm(400),
B = rnorm(400),
C = rnorm(400),
D = rnorm(400),
E = rnorm(400),
F = rnorm(400),
G = rnorm(400),
H = rnorm(400))
I want to loop aov()
and then TukeyHSD()
through variables Treat A:H, and capture the summaries of both the ANOVA and the Tukey for each variable into a single data frame. I have gotten close looking at one answer here using broom::tidy
, but cant figure out how to get the summaries into a single data frame (as opposed to printing them).
Any help is extremely appreciated!