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

Review {cfr} v0.1.0 for CRAN release #78

Merged
merged 60 commits into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
e2720bb
Edits to vignettes from code review
pratikunterwegs Sep 11, 2023
b5cffaf
Add further vignette suggestions from review
pratikunterwegs Sep 11, 2023
aa744f3
Automatic readme update
actions-user Sep 11, 2023
4b42fb7
Remove dev packages from Suggests
pratikunterwegs Sep 11, 2023
b4db0ca
Account for changes to epidist_db(), WIP #80
pratikunterwegs Sep 11, 2023
cebac16
Remove creation of empty objects
pratikunterwegs Sep 11, 2023
0201b75
Style vignettes and Readme, also WIP #80
pratikunterwegs Sep 11, 2023
0a1ae05
Update fn get_default_burn_in() for better param access
pratikunterwegs Sep 11, 2023
240f022
CFR: case fatality risk, use 'ascertainment ratio'
pratikunterwegs Sep 11, 2023
6ba4d69
Update Readme.Rmd with details on {epiparameter}
pratikunterwegs Sep 11, 2023
6ed85d9
Correct for delays is default, epidist has no default value
pratikunterwegs Sep 11, 2023
bc59789
Change outputs to use full names, e.g. 'mean' instead of 'me'
pratikunterwegs Sep 11, 2023
ea1567a
Update documentation and miscellaneous fixes
pratikunterwegs Sep 11, 2023
040ef87
Updates to vignettes
pratikunterwegs Sep 11, 2023
0b88c8f
Update Readme.Rmd and DESCRIPTION
pratikunterwegs Sep 11, 2023
706b4de
Correct Readme.Rmd for correction by default
pratikunterwegs Sep 11, 2023
d855f2c
Automatic readme update
actions-user Sep 11, 2023
e0a96e6
Update pkg data prep and documentation
pratikunterwegs Sep 13, 2023
39da19a
Simplify estimate_rolling()
pratikunterwegs Sep 13, 2023
1cf8c26
Minor tweaks to docs for estimate_severity()
pratikunterwegs Sep 13, 2023
8a42b06
Simplify estimate_ascertainment(), update docs
pratikunterwegs Sep 13, 2023
f5a0733
Add method details to estimate_static(), correct arg order
pratikunterwegs Sep 13, 2023
ca1ab86
Add mthd details est_time_var(), correct arg order
pratikunterwegs Sep 13, 2023
bc6903a
Check for parameterised epidist for get default burnin
pratikunterwegs Sep 13, 2023
943bdbf
Add checks to known_outcomes(), edit docs
pratikunterwegs Sep 13, 2023
b55d605
Unify prepare_data generic and method docs
pratikunterwegs Sep 13, 2023
2a4e0aa
Basic tests for default burn in
pratikunterwegs Sep 13, 2023
61ff1b9
Add tests for time varying ascertainment, add baseline value
pratikunterwegs Sep 13, 2023
098b38f
Add test for prepare_data with NAs present
pratikunterwegs Sep 13, 2023
2868f23
Update test snapshots
pratikunterwegs Sep 13, 2023
872bf84
Minor updates to vignettes
pratikunterwegs Sep 13, 2023
2f4153f
Update all Rd files
pratikunterwegs Sep 13, 2023
3e6330b
Update GHA workflows
pratikunterwegs Sep 13, 2023
6c3802a
Update .gitignore, .lintr, .Rbuildignore
pratikunterwegs Sep 13, 2023
ef54fa4
Add citation file
pratikunterwegs Sep 13, 2023
d26facf
Allow coordinate expansion in Readme plot
pratikunterwegs Sep 13, 2023
417f27d
Automatic readme update
actions-user Sep 13, 2023
90d787f
Unquote dataframe col names on creation
pratikunterwegs Sep 13, 2023
49d34bc
Remove empty vector creation
pratikunterwegs Sep 14, 2023
5299c07
Use mean method for epidist, fixes #81
pratikunterwegs Sep 14, 2023
9d5cc22
Rename CFR functions from estimate_* to cfr_*
pratikunterwegs Sep 14, 2023
c0eb9f2
Rm logical function args
pratikunterwegs Sep 14, 2023
b390dfc
Update Readme and add text to vignettes
pratikunterwegs Sep 14, 2023
1dfbdfc
Automatic readme update
actions-user Sep 14, 2023
a5cdca3
Fn arg epidist defaults to NULL
pratikunterwegs Sep 15, 2023
683b893
Update fn arg documentation and maths
pratikunterwegs Sep 15, 2023
4faa35b
Update math formatting in vignettes
pratikunterwegs Sep 15, 2023
9e755ff
Rename burn_in_value to burn_in, allow 0s
pratikunterwegs Sep 15, 2023
8774741
Minor formatting
pratikunterwegs Sep 15, 2023
b576c3c
Update wordlist
pratikunterwegs Sep 15, 2023
eb02092
Update documentation for burn_in arg
pratikunterwegs Sep 15, 2023
c00d74e
Update example for cfr_time_varying
pratikunterwegs Sep 15, 2023
3dc8a45
Update formatting for cfr_time_varying
pratikunterwegs Sep 15, 2023
636522d
Small possible speed up to cfr_time_varying
pratikunterwegs Sep 15, 2023
63a6759
Test that known_outcomes gives no NAs
pratikunterwegs Sep 15, 2023
c5c6527
Vectorise loop in cfr_time_varying()
pratikunterwegs Sep 15, 2023
4135d2d
Remove DS_Store file
pratikunterwegs Sep 15, 2023
78f0bf7
Rename MLE to maximum likelihood estimate
pratikunterwegs Sep 15, 2023
eebc2c4
Add citation for Covid-19 CFR estimate, add to ref library
pratikunterwegs Sep 15, 2023
3a40679
Update Rd files with new documentation
pratikunterwegs Sep 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
^revdep$
^CRAN-SUBMISSION$
^_pkgdown\.yml$
^CITATION\.cff$
50 changes: 47 additions & 3 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,48 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
#
# Reproduce locally by running:
# ```r
# pak::pak(c("any::rcmdcheck", "."), dependencies = "Config/Needs/check")
# rcmdcheck::rcmdcheck()
# ```
on:
push:
branches: [main, master]
paths:
- 'data/**'
- 'R/**'
- 'inst/**'
- 'man/**'
- 'src/**'
- 'tests/**'
- 'vignettes/**'
- 'DESCRIPTION'
- 'NAMESPACE'
- 'LICENSE'
- '.Rbuildignore'
- '.github/workflows/R-CMD-check.yaml'
pull_request:
branches:
- "*"
paths:
- 'data/**'
- 'R/**'
- 'inst/**'
- 'man/**'
- 'src/**'
- 'tests/**'
- 'vignettes/**'
- 'DESCRIPTION'
- 'NAMESPACE'
- 'LICENSE'
- '.Rbuildignore'
- '.github/workflows/R-CMD-check.yaml'

name: R-CMD-check

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}
Expand All @@ -19,7 +53,7 @@ jobs:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: macOS-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
Expand All @@ -28,6 +62,8 @@ jobs:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
# Exists since R 4.3.0 but `false` by default
_R_CHECK_LENGTH_COLON_: true

steps:
- uses: actions/checkout@v3
Expand All @@ -46,5 +82,13 @@ jobs:
needs: check

- uses: r-lib/actions/check-r-package@v2
id: rcmdcheck
with:
upload-snapshots: true

# fail-fast but only if rcmdcheck step fails
- name: Manual fail-fast
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: always() && steps.rcmdcheck.outcome == 'failure'
run: gh run cancel ${{ github.run_id }}
47 changes: 41 additions & 6 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,52 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
#
# Reproduce locally by running:
# ```r
# pak::pak(c("any::pkgdown", "."), dependencies = "Config/Needs/website")
# pkgdown::build_site()
# ```
on:
push:
branches: [main, master]
paths:
- 'README.Rmd'
- 'README.md'
- 'index.Rmd'
- 'index.md'
- 'man/**'
- 'vignettes/**'
- '_pkgdown.yml'
- 'pkgdown/**'
- 'DESCRIPTION'
- '.Rbuildignore'
- '.github/**'
pull_request:
branches: [main, master]
paths:
- 'README.Rmd'
- 'README.md'
- 'index.Rmd'
- 'index.md'
- 'man/**'
- 'vignettes/**'
- '_pkgdown.yml'
- 'pkgdown/**'
- 'DESCRIPTION'
- '.Rbuildignore'
- '.github/**'
release:
types: [published]
workflow_dispatch:

name: pkgdown

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
pkgdown:
runs-on: ubuntu-latest
# Only restrict concurrency for non-PR jobs
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
Expand All @@ -41,8 +71,13 @@ jobs:

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4.4.1
uses: JamesIves/github-pages-deploy-action@4.1.4
with:
clean: false
# We clean on releases because we want to remove old vignettes,
# figures, etc. that have been deleted from the `main` branch.
# But we clean ONLY on releases because we want to be able to keep
# both the 'stable' and 'dev' websites.
# Also discussed in https://github.com/r-lib/actions/issues/484
clean: ${{ github.event_name == 'release' }}
branch: gh-pages
folder: docs
9 changes: 4 additions & 5 deletions .github/workflows/render_readme.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Name of the workflow
name: render-readme

# Controls when the action will run. Triggers include:
#
#
# - button trigger from github action page
# - on changes to readme.Rmd

Expand Down Expand Up @@ -34,12 +33,12 @@ jobs:

- name: Setup pandoc
uses: r-lib/actions/setup-pandoc@v2

- name: Install dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rmarkdown, local::.

- name: Compile the readme
run: |
writeLines(
Expand All @@ -56,7 +55,7 @@ jobs:
output_dir = "."
)
shell: Rscript {0}

- name: Commit files
run: |
git config --local user.email "action@github.com"
Expand Down
41 changes: 19 additions & 22 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,25 @@
on:
push:
branches: [main, master]
paths:
- 'R/**'
- 'src/**'
- 'tests/**'
- 'inst/**'
- 'DESCRIPTION'
- '.github/workflows/test-coverage.yaml'
pull_request:
branches:
- "*"
paths:
- 'R/**'
- 'src/**'
- 'tests/**'
- 'inst/**'
- 'DESCRIPTION'
- '.github/workflows/test-coverage.yaml'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

name: test-coverage

Expand All @@ -28,24 +44,5 @@ jobs:
needs: coverage

- name: Test coverage
run: |
covr::codecov(
quiet = FALSE,
clean = FALSE,
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
)
run: covr::codecov(quiet = FALSE)
shell: Rscript {0}

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v3
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
56 changes: 50 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,55 @@
.Rproj.user
# History files
.Rhistory
.Rapp.history

# Session Data files
.RData
.RDataTmp

# User-specific files
.Ruserdata

# Example code in package build process
*-Ex.R

# Output files from R CMD build
/*.tar.gz

# Output files from R CMD check
/*.Rcheck/

# RStudio files
.Rproj.user/

# produced vignettes
vignettes/*.html
vignettes/*.pdf

# OAuth2 token, see https://github.com/hadley/httr/releases/tag/v0.3
.httr-oauth

# knitr and R markdown default cache directories
*_cache/
/cache/

# Temporary files created by R markdown
*.utf8.md
*.knit.md

# R Environment Variables
.Renviron

# pkgdown site
docs/

# translation temp files
po/*~

# RStudio Connect folder
rsconnect/

# macOS hidden files
.DS_Store
docs
inst/doc
/doc/
/Meta/

# ignore development file
scratch.R
pkgdown/favicon/
10 changes: 9 additions & 1 deletion .lintr
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ linters: linters_with_tags(
todo_comment_linter = NULL,
function_argument_linter = NULL,
indentation_linter = NULL, # unstable as of lintr 3.1.0
# Use minimum R declared in DESCRIPTION or fall back to current R version
# Use minimum R declared in DESCRIPTION or fall back to current R version.
# Install etdev package from https://github.com/epiverse-trace/etdev
backport_linter(if (length(x <- etdev::extract_min_r_version())) x else getRversion())
)
exclusions: list(
"tests/testthat.R" = list(unused_import_linter = Inf),
"data-raw" = list(
missing_package_linter = Inf,
namespace_linter = Inf
)
)
Loading