I have a some data with month and sales. Is there way I can loop over all the months and get the mean
I'm not sure how to do this still very new at R
df2 <- df[grep("Jan", df$Month),]
mean(df2$Sales)
Rather than typing each month every time. Is there a way I can just get R to loop over all the months and give a mean for each month