Error while using tidytable packge dealing with timeseries data

69 Views Asked by At

I have a time series data with two columns timestamps and value:

as.data.table(structure(list(timestamp = c("2023-10-04 09:59:58", "2023-10-04 10:02:58", 
"2023-10-04 10:05:58", "2023-10-04 10:08:58", "2023-10-04 10:11:58", 
"2023-10-04 10:14:58", "2023-10-04 10:17:58"), value = c(1, 2.5, 
4, 5.5, 7, 8.5, 10)), row.names = c(NA, -7L), class = c("data.table", 
"data.frame")))

Im trying to find the average value at every 15min interval

library(tidytable)
library(dplyr)



averaged_df <- df %>%
  group_by(interval = floor_date(timestamp, "15 minutes")) %>%
  summarise(average_value = mean(value))

Error in group_by(): ℹ In argument: interval = floor_date(timestamp, "15 minutes"). Caused by error in floor_date(): ! could not find function "floor_date"

Without tidytable it works as expected but when the tidytable is loaded it gives the above error.

1

There are 1 best solutions below

0
Golem On

https://github.com/markfairbanks/tidytable/issues/772

group_by() cannot be used to create columns instead mutate() should be used when tidytable is loaded.

markfairbanks