I would start with code like the following. The columns for MinYear and MaxYear are not necessary, but if you will have several data frames like this, it might help you keep track of what you are looking at.
library(lubridate)
#>
#> Attaching package: 'lubridate'
#> The following object is masked from 'package:base':
#>
#> date
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:lubridate':
#>
#> intersect, setdiff, union
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
#make fake data
df <- data.frame(Date = seq.Date(from = ymd("2015-01-01"), to = ymd("2019-12-31"), by = 1),
Value = runif(1826, 0, 5))
df <- df %>% mutate(Year = year(Date), Mnth = month(Date), Day = day(Date))
Stats <- df %>% group_by(Mnth, Day) %>%
summarize(Avg = mean(Value), Max = max(Value), Min = min(Value),
MinYear = min(Year), MaxYear = max(Year))
head(Stats)
#> # A tibble: 6 x 7
#> # Groups: Mnth [1]
#> Mnth Day Avg Max Min MinYear MaxYear
#> <dbl> <int> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 1 1 2.72 4.26 1.38 2015 2019
#> 2 1 2 2.46 3.60 1.16 2015 2019
#> 3 1 3 1.82 3.81 0.492 2015 2019
#> 4 1 4 3.38 4.64 0.938 2015 2019
#> 5 1 5 2.98 4.50 1.24 2015 2019
#> 6 1 6 2.32 4.25 0.148 2015 2019
Created on 2019-05-16 by the reprex package (v0.2.1)
I am not sure how you want to handle your data set of ten years; either stepping through 2010-2014, 2011-2015 ... 2015-2019 or just do two calculations 2010-2014 and 2015-2019. In either case, you can construct a for loop and use the filter() function to grab the subset that you need. Each output data frame can be stored in a list. I can provide more detail if you can explain how you want to split up the years.