Reducing time series data from half hour to hourly in R - Stack Overflow

PHOTO EMBED

Fri Nov 12 2021 15:28:24 GMT+0000 (Coordinated Universal Time)

Saved by @GeeseGoose #r

# create grouped column
test1$grouped_time = lubridate::floor_date(test1$DateTime, unit = "hour")
# (use ceiling_date instead if you want to round the half hours up instead of down)

# sum by group
library(dplyr)
test2 = test1 %>%
  group_by(grouped_time, LCLid, stdorToU, Acorn, Acorn_grouped) %>%
  summarize(KWH.hh.per.hour = sum(KWH.hh..per.half.hour.))
content_copyCOPY

https://stackoverflow.com/questions/59395540/reducing-time-series-data-from-half-hour-to-hourly-in-r