How can I run an ANOVA over each column using a loop or apply a function as opposed to rewriting the same code for each column variable? Also, I would like to run an ANOVA for each species separately and have it output ANOVA tables. Sample data and sample lm model I want to run below.
block trtmt species rep days_til_flower days_til_anthesis days_til_harvest
1 1 H12 CR 1 9 21 59
2 1 H12 CR 2 7 20 57
3 1 H12 LB 1 7 20 62
4 1 H12 LB 2 13 21 62
5 1 H12 YC 1 7 17 59
6 1 H12 YC 2 7 16 59
model = lm(column ~ block + trtmt*species, data=data1)