It's my first couple of weeks using R and I've been breaking my head over a problem. I hope you guys can help me out!
I'm doing a multiway ANOVA (aov(Eicosane~SEX+STATUS,data=data_wide). Now I have about 26 different dependent variables, which are chemical compounds(in this example Eicosane) found on Drosophila suzukii fruit flies and I want to see if the chemical compound found can be addressed to sex or status. Is there a way to use some kind of loop so I don't need to change the dependent variable manually each time and can get the output in 1 file?
Someone recommended; {For (i in 1:26)}
(aov(i ~SEX+STATUS,data=data_wide)}
Result}
But it gives Error: unexpected 'in'. Does R automatically number my colums in my dataset as 1,2,3 etc... ?
I hope it's a bit clear and my apologies for this newbie question but I just can't seem to figure it out myself.
Thanks a lot!