reconverse / incidence2

Compute and visualise incidence (reworking of the original incidence package)
https://www.reconverse.org/incidence2
Other
17 stars 2 forks source link

`plot()` and `facet_plot()` scaling issues due to `interval` and `show_cases = TRUE` #77

Closed arnold-c closed 1 year ago

arnold-c commented 3 years ago

Please place an "x" in all the boxes that apply


When using the argument show_cases = TRUE, the image renders incorrectly using the "week" interval.

library(tidyverse)
library(outbreaks)
library(incidence2)

measles_data <- measles_hagelloch_1861 %>%
  tibble()

raw_incidence_week <- incidence(
  measles_data,
  date_of_prodrome,
  interval = "week",
  groups = c(gender, class)
  )

raw_incidence_day <- incidence(
  measles_data,
  date_of_prodrome,
  interval = "day",
  groups = c(gender, class)
  )

# No issues
raw_incidence_day %>%
  plot(
    show_cases = TRUE
  )
#> plot() can only stack/dodge by one variable.
#> For multi-facet plotting try facet_plot()

# Issues
raw_incidence_week %>%
  plot(
    show_cases = TRUE
  )
#> plot() can only stack/dodge by one variable.
#> For multi-facet plotting try facet_plot()

# No issues
raw_incidence_week %>%
  plot(
    show_cases = FALSE
  )
#> plot() can only stack/dodge by one variable.
#> For multi-facet plotting try facet_plot()

Created on 2021-11-23 by the reprex package (v2.0.1)



---------
TimTaylor commented 2 years ago

@arnold-c - Cheers for the report. A little tied up with other work at the moment but will take a look when time permits.

TimTaylor commented 1 year ago

Closing as show_cases is no longer a parameter as of https://github.com/reconverse/incidence2/commit/1ef0420a031462eb252d69046fd6fc8f8f1b6c82