-
Notifications
You must be signed in to change notification settings - Fork 3
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
Review {cfr} v0.1.0 for CRAN release #78
Conversation
I went through the {cfr} package and have some comments that I'd want to share with you. 1- I see an entanglement between two arguments: |
Thanks @Bisaloo, will wait for other reivews to come in and move to fix in the week of 11th Sept. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good overall. There are few issues I had with pulling from epiparameter – it may be a version problem, but wanted to flag.
General comment: the documentation uses a mix of 'case fatality rate', 'case fatality risk' and 'case fatality ratio', sometimes within the same document (e.g. vignette). We should pick one for consistency. 'Case fatality rate' is most commonly used, even though it is technically inaccurate (the value calculated is a risk rather than a rate). I would therefore go with 'case fatality risk' (or 'case fatality ratio' if this requires less refactoring).
Similarly, 'ascertainment rate' isn't really a rate - perhaps 'ascertainment ratio' or 'ascertainment probability' would be better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{cfr} full package review
I think {cfr} is in good shape and will be ready to be submitted to CRAN following this full package review. I have added general comments below as well as line-by-line comments on most of the changed files. Feel free to request my replies under the conversations I've started.
Routine automatic checks
The following routine checks were performed on the package and did not raise any issues.
-
devtools::check()
-
goodpractice::gp()
-
lintr::lint_package()
-
styler::style_pkg
-
covr::package_coverage()
README
General comments
- The README looks fine to me. It's clear and concise, and all the badges are appropriate.
Improvements
- I have added line specific comments to the README file.
- I suggest to provide a brief overview of the core functions and what they do. This will help users to quickly understand what the package does and how to use it.
Functions
General comments
estimate_static()
:- One major comment is for you to add details on the methods and references for the CFR estimation. This is important for people who are not familiar with CFR and want to learn more about it. Same comment goes for
known_outcomes()
. - Additionally, I would suggest adding a
_cfr
suffix to this function and others, i.e.estimate_static_cfr()
. This will help users to quickly identify the functions that estimate CFRs.
- One major comment is for you to add details on the methods and references for the CFR estimation. This is important for people who are not familiar with CFR and want to learn more about it. Same comment goes for
known_outcomes()
:estimate_ascertainment()
: I would be interested to see the methods for this function as I am a little worried about its inner workings. For example, its results are highly sensitive to theseverity_baseline
argument, which is user supplied rather than estimated. I also have a little quibble about replacing all ascertainment ratios > 1 with 1. It seems hacky and I wonder why it is not dealt with by the model but rather as a post-processing step.
Improvements
- I have added line specific comments to each function.
Vignettes
General comments
- The vignettes lay out the core functionality in the package and are insightful. I have added line specific comments.
- As a general comment, since vignettes are basically literate programming, I usually prefer not to use redundant phrases like "using the code below" or "the code below", "the following code", etc. The accompanying code should reinforce the written words.
Specific comments
- "Estimating the proportion of cases that are ascertained during an outbreak":
- Another way to visualize the results to remove the effect of the
severity_baseline
argument is to plot the relative ratios between the countries so that the baseline severity cancels out, ruling out its effect.
- Another way to visualize the results to remove the effect of the
- "Calculating a static, delay-adjusted estimate of disease severity":
- I'm not convinced that Fig 3 and 7 are necessary. It's not clear what it adds to the text. I would suggest to remove it. It looks like something that belongs in {epiparameter} rather than {cfr}.
- I would suggest moving the section "Details: Adjusting for delays between two time series" to a theory vignette like in bpmodels and the details section of the respective functions. To be honest, it looks good here and seems to fit the context. Another way to go about it would be to hyperlink to the theory vignette at the beginning and end of this vignette like you have for the Getting Started vignette.
- I would suggest replacing the generic use of "known outcomes" with the specifics. I think in this vignette, it is the known death outcomes.
- "Estimating how disease severity varies over the course of an outbreak":
- Title seems long. Suggest shortening to, for example, "Estimating time-varying CFRs"
- Same as before, I'm not convinced that Fig 3 is necessary. It's not clear what it adds to the text. I would suggest to remove it.
- Suggest adding a legend to Fig 4 and 5 indicate what the grey and tomato lines/ribbons represent.
- Also, what is going on before April in Figs 4 and 5? The ribbons look weird and are hard to interpret.
- Refer to my earlier comment above on moving the section "Details: Adjusting for delays between two time series".
Improvements
- I have added line specific comments to each vignette.
Other infrastructure
DESCRIPTION
Package version is missing the patch number, i.e., currently 0.1
instead of 0.1.0
. I would suggest to addding it to conform with the rest of our packages.
Tests
- Might be worthwhile to provide more descriptive contexts for the tests, for example,
test_that("multiplication works", ...
. - I did not inspect the tests in detail so do not have detailed comments.
Full package review for {cfr}.Overall the package looks good. It is functionally to the point which should help new users get to grips with the aims and applications of the package. The documentation is clearly written and provides a comprehensive overview of the functions and data requirements. I like that the package is minimal in terms of namespace but contains a good amount of functionality. The inclusion of two datasets provides two clear use-cases for the package. I've left some comments below. Some of these overlap with those already made by other reviewers but I thought I'd leave them in just to ensure they weren't missed. Functions
Documentation
Testing
Package infrastructure
Speculative idea: what if |
Thanks all for your feedback - I shall work on reconciling your suggestions and making changes this week. I would say the aim is to be ready for a CRAN submission as soon as possible, ideally within this week. |
This commit adds a number of edits bundled together in a batch. Co-authored-by: Adam Kucharski <adam.kucharski@lshtm.ac.uk> Co-authored-by: James Azam <james.m.azam@gmail.com>
Co-authored-by: James Azam <james.m.azam@gmail.com>
Fix get_default_burn_in() Use {epiparameter} fns in get_default_burn_in()
The following linked issue in {serofoi} might be relevant to this conversation. @zmcucunuba also thinks that it makes sense to have two separate routines for preparing the data and modelling. See epiverse-trace/serofoi#61. |
Thanks again everyone for your feedback. The proposed and (some) scheduled changes have now been implemented. This PR will be retargeted to |
What's the motivation for this change? This is discussed in the tidyverse design guide as well: https://design.tidyverse.org/required-no-defaults.html |
This has been changed to NULL by default in a5cdca3 |
This PR is for a full package review prior to a CRAN release, and is also working towards items in the release checklist in #68.
This PR will be used to collect and address reviwer comments. Either this branch, or issue-specific branches will be used to push changes. The changes will be merged into
main
prior to release.The proposed timeline is for all reviews to be in by 8th September 2023. The goal is to have {cfr} released to CRAN soon after. This schedule is contingent on releasing {epiparameter} to CRAN.
I would encourage/request two reviewers to sign up to do the full review. Please tick a box and assign yourself in the Reviewers panel on the right to indicate that you have taken on the review.
Following review this PR also fixes #80 and fixes #81.