MATLAB: Timetable Monthly Average over Many Years

MATLABmeanmonthlyretimetimetable

I have a daily precipitation data file with two columns.The first column is "date", with date format yyyy-mm-dd and the second column is "precip" with double format. My data ranges from 1980-01-01 to 2010-12-31, and I would like to determine the average precipitation values for each month over that interval.
Example of desired result:
Month avgPrecip
Jan 0.0056
Feb 0.0034
for each month.
I have attached my csv file with the data and my current progess. I can get the monthly average of the data within each year using a timetable and retime, but I am stuck trying to average the monthly average data for the entire data range. Thank you!
precip = readtable('CR_precip.csv');
precip = table2timetable(precip);
monthlyAvg = retime(precip,'monthly','mean');

Best Answer

The easiest:
precip = table2timetable(readtable('CR_precip.csv'));
monthlyavg = groupsummary(precip, 'day', 'monthofyear', 'mean')