Reprexes are not just for errors. They allow others to reconstruct a sample of your data. That is very handy when it comes to figuring out an appropriate solution.
Since I don't know what your data looks like, I'll make up some of my own and illustrate how to aggregate it. You can adapt it to your needs.
library(dplyr, warn.conflicts = FALSE)
library(lubridate, warn.conflicts = FALSE)
df <- tibble::tribble(~date, ~value,
"2002-01-02", 20,
"2002-01-05", 50,
"2002-01-07", 35,
"2002-02-03", 10,
"2002-02-08", 70,
"2003-01-16", 10,
"2003-01-25", 90) %>%
mutate(date = as.Date(date))
df %>%
group_by(year = year(date), month = month(date, label = TRUE)) %>%
summarise(total_value = sum(value))
#> `summarise()` regrouping output by 'year' (override with `.groups` argument)
#> # A tibble: 3 x 3
#> # Groups: year [2]
#> year month total_value
#> <dbl> <ord> <dbl>
#> 1 2002 Jan 105
#> 2 2002 Feb 80
#> 3 2003 Jan 100
Created on 2020-11-20 by the reprex package (v0.3.0)