-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make_lights and geom_lights fail with reversed light cycle #5
Labels
bug
Something isn't working
Comments
Related, if there is only one day in the recording, |
library(tidyverse)
library(fed3)
theme_set(theme(text = element_text(size = 16)))
fw_files <- list.files("/home/matias/Experiments/pilots/long_term/MLA127/FED_data/fedwatcher/2023/08/",
recursive = T,
full.names = T)
fw_df <- map(fw_files, function(tt) read_fed(tt, lib_version = "fw")) %>%
bind_rows()
#> Warning: One or more parsing issues, call `problems()` on your data frame for details,
#> e.g.:
#> dat <- vroom(...)
#> problems(dat)
#> One or more parsing issues, call `problems()` on your data frame for details,
#> e.g.:
#> dat <- vroom(...)
#> problems(dat)
#> One or more parsing issues, call `problems()` on your data frame for details,
#> e.g.:
#> dat <- vroom(...)
#> problems(dat)
#> One or more parsing issues, call `problems()` on your data frame for details,
#> e.g.:
#> dat <- vroom(...)
#> problems(dat)
#> One or more parsing issues, call `problems()` on your data frame for details,
#> e.g.:
#> dat <- vroom(...)
#> problems(dat)
#> One or more parsing issues, call `problems()` on your data frame for details,
#> e.g.:
#> dat <- vroom(...)
#> problems(dat)
#> One or more parsing issues, call `problems()` on your data frame for details,
#> e.g.:
#> dat <- vroom(...)
#> problems(dat)
#> One or more parsing issues, call `problems()` on your data frame for details,
#> e.g.:
#> dat <- vroom(...)
#> problems(dat)
min_dt <- min(fw_df$Pi_Time)
# Normal cycle
fw_df %>%
filter(lubridate::day(Pi_Time) < 8) %>%
recalculate_pellets() %>%
ggplot(aes(Pi_Time, pellets)) +
geom_lights() +
geom_step() +
scale_x_datetime(breaks = "6 hours", date_labels = "%H") # Fake reversed cycle
fw_df %>%
filter(lubridate::day(Pi_Time) < 8) %>%
recalculate_pellets() %>%
ggplot(aes(Pi_Time, pellets)) +
geom_lights(lights_off_hour = 7, lights_on_hour = 19) +
geom_step() +
scale_x_datetime(breaks = "6 hours", date_labels = "%H") # Less than a day
fw_df %>%
filter(lubridate::day(Pi_Time) == 8) %>%
recalculate_pellets() %>%
ggplot(aes(Pi_Time, pellets)) +
geom_lights(lights_off_hour = 19, lights_on_hour = 7) +
geom_step() +
scale_x_datetime(breaks = "6 hours", date_labels = "%H") Created on 2023-08-11 with reprex v2.0.2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This
and
produce the same plot
When they should produce opposite shading patterns. I'm not sure whether the error is in the calculation itself or in the way ggplot treats
geom_rect()
internals.The text was updated successfully, but these errors were encountered: