Open matiasandina opened 11 months ago
Here are the unit tests with expected results Ideally this should be incorporated to the examples and tests
library(tidyverse) library(fed3) df <- tibble( group_col = c(1, 1, 1, 2, 2, 3, 3, 3), datetime_col = c( as.POSIXct("2023-01-01 12:00:00"), as.POSIXct("2023-01-01 12:30:00"), as.POSIXct("2023-01-03 10:00:01"), as.POSIXct("2023-01-01 13:15:00"), as.POSIXct("2023-01-01 13:45:00"), as.POSIXct("2023-01-20 10:00:00"), as.POSIXct("2023-01-20 11:00:00"), as.POSIXct("2023-01-31 16:00:00") ) ) df %>% group_by(group_col) %>% set_alignment(datetime_col, "midnight") df %>% group_by(group_col) %>% set_alignment(datetime_col, "time") # One issue here is the change of dttm to drtn, maybe we can consider behaving differently df %>% group_by(group_col) %>% set_alignment(datetime_col, "elapsed")
Here are the unit tests with expected results Ideally this should be incorporated to the examples and tests