MaxWeekMaxTemp = function(sensor_site = "RAYNER_DOWN.", timeperiod = "6 Days", summstat = mean) {
filtered =temps %>%
filter(site == sensor_site)
filtered$DateTime = as.Date(filtered$DateTime, "%m/%d/%Y")
filtered = filtered %>%
group_by(site) %>%
summarise_by_time(
.date_var = DateTime,
.by = timeperiod,
#.week_start = 1,
value = summstat(temp))
When I enter this code and plot the result everything looks right except for at the ends of the month. As you can see in the graph, grouping starts over at the first of the month leaving a bin that is only 3 days long. I have played around with a lot of different packages to group by week, and this almost works. Any idea what is wrong???
Thanks
I tried using timetk to group_by 6 day time intervals. This works except when a new month starts