Is there an R function that helps with getting monthly return data into yearly means? This is the code I\'ve used so far for returns of the apple stock. It comes in three column