Skip to content
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

Strange graphical output for simple epicurve #119

Closed
gfspiteri opened this issue Mar 9, 2020 · 9 comments · Fixed by #120
Closed

Strange graphical output for simple epicurve #119

gfspiteri opened this issue Mar 9, 2020 · 9 comments · Fixed by #120
Assignees

Comments

@gfspiteri
Copy link

I have been producing simple epicurves for the outbreak of COVID-19. Last Friday my outputs started acting weirdly with data not being plotted and the x-axis disappearing (I don't know that I changed anything/installed any new packages/upgraded anything etc). I tried using simple examples from the incidence package help file and again got very strange outputs. For example:

library(outbreaks)
library(ggplot2)
library(incidence)
dat <- ebola_sim$linelist$date_of_onset
i <- incidence(dat)
plot(i)

leads to

image

This is my sessionInfo() output:

R version 3.6.3 (2020-02-29)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=English_United Kingdom.1252  LC_CTYPE=English_United Kingdom.1252   
[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C                           
[5] LC_TIME=English_United Kingdom.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] incidence_1.7.0 ggplot2_3.3.0   outbreaks_1.5.0

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.3       rstudioapi_0.11  magrittr_1.5     tidyselect_1.0.0 munsell_0.5.0    colorspace_1.4-1
 [7] R6_2.4.1         rlang_0.4.5      dplyr_0.8.5      tools_3.6.3      grid_3.6.3       gtable_0.3.0    
[13] withr_2.1.2      yaml_2.2.1       assertthat_0.2.1 digest_0.6.25    tibble_2.1.3     lifecycle_0.2.0 
[19] crayon_1.3.4     purrr_0.3.3      farver_2.0.3     glue_1.3.1       labeling_0.3     compiler_3.6.3  
[25] pillar_1.4.3     aweek_1.0.0      scales_1.1.0     pkgconfig_2.0.3 

Any help appreciated!

@thibautjombart
Copy link
Contributor

Thanks for the report. It is very weird. I'll try and see if I can reproduce it with the latest version of R.

@thibautjombart
Copy link
Contributor

I can confirm the issue on:

> sessionInfo()
R version 3.6.3 (2020-02-29)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.4 LTS

Matrix products: default
BLAS:   /usr/local/lib/R/lib/libRblas.so
LAPACK: /usr/local/lib/R/lib/libRlapack.so

locale:
 [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_GB.UTF-8        LC_COLLATE=en_GB.UTF-8    
 [5] LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_GB.UTF-8   
 [7] LC_PAPER=en_GB.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] incidence_1.7.0 ggplot2_3.3.0   outbreaks_1.5.0

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.3       digest_0.6.25    withr_2.1.2      assertthat_0.2.1
 [5] crayon_1.3.4     dplyr_0.8.5      grid_3.6.3       R6_2.4.1        
 [9] lifecycle_0.2.0  gtable_0.3.0     magrittr_1.5     scales_1.1.0    
[13] pillar_1.4.3     rlang_0.4.5      farver_2.0.3     labeling_0.3    
[17] glue_1.3.1       purrr_0.3.3      munsell_0.5.0    compiler_3.6.3  
[21] pkgconfig_2.0.3  colorspace_1.4-1 tidyselect_1.0.0 tibble_2.1.3    
> 

Will address today.

@thibautjombart
Copy link
Contributor

This looks like some buggish behaviour of ggplot2::aes_string. Working on a workaround

@thibautjombart
Copy link
Contributor

Now reported the bug to the Rstudio crew: tidyverse/ggplot2#3873

@thibautjombart
Copy link
Contributor

@gfspiteri can you try installing this patch:

remotes::install_github("reconhub/incidence@issue_119")

And let me know if it fixes your issue?

@gfspiteri
Copy link
Author

Thanks yes works well both for the ebola data and my script.

@thibautjombart
Copy link
Contributor

Great, thanks. I have submitted a PR. This will be in the next release on CRAN, hopefully soon as this is a major bug. Thanks for reporting it!

@gfspiteri
Copy link
Author

gfspiteri commented Mar 9, 2020 via email

@thibautjombart
Copy link
Contributor

Reopening because the problem still exist on master, until the PR goes through

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants