I'm sure it's already been covered, but I can't make it work and so I've decided to ask my question for my specific data.
I have a dataset of hourly measured cloud cover. I'm trying to calculate the mean per day. I have already separated my data and so I have a column with the date in format YYYY-MM-DD and another column with cloud cover. I'm trying to calculate the mean cloud cover for each hourly observation (same date).
ex :
Date = c(2010-01-03, 2010-01-03, 2010-01-03, 2010-01-04, 2010-01-04, 2010-01-04, 2010-01-05, 2010-01-05)
Cloud_cover = c(5,5,2,3,5,1,5,4)
I would like to obtain a the mean cloud_cover value of every observation with 2010-01-03 and 2010-01-04 and so on.
Next step would be to create a new dataset with only the mean values, but I'll get to that later.
Thanks
question from:
https://stackoverflow.com/questions/66052969/calculate-daily-mean-with-hourly-data-in-r 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…