I'm trying to write the summaries of multiple ANOVA runs, stored in a list, to a CSV file.
for(i in anova_results) {
output = summary(anova_results[[i]])
form = sprintf('anovaresult_%s.csv', i)
capture.output(output, file = form)
}
However, upon doing some I'm getting an error on the 'subscript type':
Error in anova_results[[i]] : invalid subscript type 'list'
Upon searching this error, I can't seem to figure out why this loop won't work.