Closed matiasandina closed 1 year ago
This could potentially solve the issue
df %>%
recalculate_pellets() %>%
add_zt(Pi_Time, lights_on_hour = 7) %>%
bin_pellets_lightcycle(zt, lights_on_hour = 0, lights_off_hour = 12)
But I think the user should not need to know this, it's better to intercept the use of zt and adjust. When using zt, we should also have a zt_date and a date, since it can be really confusing for the user. Unfortunately, we would need to add an extra parameter to the function to keep the original date...Will evaluate in the future if it makes sense at all.
The
lights_on_hour
is given in local time instead of being given in zt time. This will produce erroneous binning. I think that it's easy to catch that bin_pellets_lightcycle is being called with zt and modify lights_on_hour to 0 and lights_off_hour to 12. This function will mostly be used withzt
anyway since we want the light/dark info instead of the date, so it's better this way. We can also add azt_date
to this result to make clear that we are talking aboutzt
datetime instead ofdate
.