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

Patch issue 119 (broken plots) #120

Merged
merged 10 commits into from
Mar 16, 2020
Merged

Patch issue 119 (broken plots) #120

merged 10 commits into from
Mar 16, 2020

Conversation

thibautjombart
Copy link
Contributor

@thibautjombart thibautjombart commented Mar 9, 2020

This is a patch for plot.incidence which is currently broken due to this issue in ggplot2, as described in #119.

Outline of patch

  • x-axis dates are now the original dates, no longer the middle of the corresponding interval
  • geom_col replaces geom_bar(..., stat = "indentity")
  • version: 1.7.0 -> 1.7.1

This fixes the issue on:

> R.version
               _                           
platform       x86_64-pc-linux-gnu         
arch           x86_64                      
os             linux-gnu                   
system         x86_64, linux-gnu           
status                                     
major          3                           
minor          6.3                         
year           2020                        
month          02                          
day            29                          
svn rev        77875                       
language       R                           
version.string R version 3.6.3 (2020-02-29)
nickname       Holding the Windsock        

Unrelated stuff that came up

I get unrelated warnings re documentation (see below) which I ignored as probably unrelated to this patch.

checking Rd files ... WARNING
  prepare_Rd: man/fit.Rd:36: unknown macro '\item'
  prepare_Rd: man/fit.Rd:40: unknown macro '\item'
  prepare_Rd: man/fit.Rd:43: unknown macro '\item'
  prepare_Rd: man/fit.Rd:46: unknown macro '\item'
  prepare_Rd: man/fit.Rd:52: unknown macro '\item'
  prepare_Rd: man/fit.Rd:54: unexpected section header '\value'
  prepare_Rd: man/fit.Rd:94: unexpected section header '\description'
  prepare_Rd: man/fit.Rd:107: unexpected section header '\examples'
  prepare_Rd: man/fit.Rd:152: unexpected section header '\seealso'
  prepare_Rd: man/fit.Rd:157: unexpected section header '\author'
  prepare_Rd: man/fit.Rd:161: unexpected END_OF_INPUT '
  '
  checkRd: (5) fit.Rd:0-162: Must have a \descriptionchecking Rd \usage sections ... WARNING
  Undocumented arguments in documentation object 'fit'quiet’ ‘window’ ‘plot’ ‘separate_split’ ‘...Functions with \usage entries need to have the appropriate \alias
  entries, and all their arguments documented.
  The \usage entries must correspond to syntactically valid R code.
  See chapterWriting R documentation filesin theWriting R
  Extensionsmanual.

R/plot.R Outdated Show resolved Hide resolved
NEWS.md Outdated Show resolved Hide resolved
@zkamvar
Copy link
Member

zkamvar commented Mar 10, 2020

Thank you for jumping on this quickly, Teebz :)

It does fix the problem stated, but creates the problem that the model fitting no longer works fits curves on the edges of the bars instead of the middle. That being said, I don't think I would have come up with anything different given the ggplot2 bug.

A side note: there is also a new fun issue from R 4.0's default of stringsAsFactors = FALSE: https://travis-ci.org/reconhub/incidence/jobs/660131096#L8198-L8202

This popped up because we never enabled cron jobs on travis for this repo, but live and learn.

@thibautjombart
Copy link
Contributor Author

I have recompiled the doc with R 3.6.3 and devtools_2.2.2 but did not find any immediate fix for the warnings on fit.Rd. I cannot reproduce the issues reported on Travis.

@zkamvar
Copy link
Member

zkamvar commented Mar 11, 2020

I cannot reproduce the issues reported on Travis.

This is because it only exists on R-devel. The solution is to explicitly state stringsAsFactors = TRUE wherever data frames are being created (likely in the tests files).

@thibautjombart
Copy link
Contributor Author

I have not chased the source of the warning, working flat out on covid19 work. Will call for help on RECON slack to finish the PR. More and more people are reporting this issue.

Starting with 7.0.0 roxygen excapes percentage signes automatically
To be compatible with R 4.0.0
@dirkschumacher
Copy link
Member

@zkamvar @thibautjombart seems that fixed the isses in the tests

@thibautjombart thibautjombart merged commit 5e0b96b into master Mar 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

strange problem in plotting Strange graphical output for simple epicurve
3 participants