I need some help on figuring out how to add titles to multiple outputs into one text file. I have tried to use the cat() and sink() function but it's not really producing the output I want. Here is an example of what I want. For example say that I have 3 linear models:
model1 --> lm(weight~variety, data=testdat) model2 --> lm(height ~ variety, data = testdat) model3 ---> lm(N2conc ~ variety, data =testdat) aov(model1) aov(model2) aov(model3)
I want to make a text file that has a list of all the anovas with the model for each anova in a text file. I want something like this:
**Anova_output.txt** model1 --> lm(weight~variety, data=testdat) ### I want model as the title so I can distinguish each anova data [anova data of model 1] model2 --> lm(height ~ variety, data = testdat) [anova data of model 2] model3 ---> lm(N2conc ~ variety, data =testdat) [anova data model3]
Any guidance on this would be helpful. Thanks!