Dear R users, I have this kind of data set:
structure(list(Year = c(1985L, 1985L, 1985L, 1985L, 1985L, 1985L, 1985L, 1985L, 1985L, 1985L, 1985L, 1985L, 1985L, 1985L, 1985L, 1985L, 1985L, 1985L, 1985L, 1985L), Day = 1:20, Month = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), Amount = c(1, 10, 1.5, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 0)), .Names = c("Year", "Day", "Month", "Amount"), row.names = c(NA, 20L), class = "data.frame") I would like to do a block average for every three days i.e. Average(1Jan-3Jan, 2Jan-4Jan, 3Jan-5Jan,...29Dec-31Dec, 30Dec-1jan). I want to do this for each year and take the maximum value of the 3 day averages in each year to create a series of maxima. How to do this in R? Many thanks for helping me. Arshad [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.