From 2ce0001395e33a1f80e1eb9ea2ad94f6fd6ae074 Mon Sep 17 00:00:00 2001 From: Kaitlyn Johnson Date: Mon, 27 Jan 2025 13:28:00 +0000 Subject: [PATCH 01/18] add minimal description file --- DESCRIPTION | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 DESCRIPTION diff --git a/DESCRIPTION b/DESCRIPTION new file mode 100644 index 0000000..cb70b5e --- /dev/null +++ b/DESCRIPTION @@ -0,0 +1,44 @@ +Package: baselinenowcast +Title: Baseline nowcast +Version: 0.0.0.1000 +Authors@R: + c(person(given = "Kaitlyn", + family = "Johnson", + role = c("aut", "cre", "cph"), + email = "kaitlyn.johnson@lshtm.ac.uk", + comment = c(ORCID = "0000-0001-8011-0012")), + person(given = "Sam", + family = "Abbott", + role = c("aut"), + email = "contact@samabbott.co.uk", + comment = c(ORCID = "0000-0001-8057-8037")), + person(given = "Johannes", + family = "Bracher", + email = "johannes.bracher@kit.edu", + comment = c(ORCID = "0000-0002-3777-1410")), + person(given = "Sebastian", + family = "Funk", + role = c("aut"), + email = "sebastian.funk@lshtm.ac.uk", + comment = c(ORCID = "0000-0002-2842-3406"))) +Description: Provides functions for nowcasting right-truncated epidemiological +data, based hevily on the method implemented in +https://github.com/KITmetricslab/RESPINOW-Hub/tree/main/code/baseline +License: MIT + file LICENSE +URL: https://github.com/epinowcast/baselinenowcast/ +BugReports: https://github.com/epinowcast/baselinenowcast/issues +Depends: + R (>= 4.0.0) +Suggests: + dplyr, + ggplot2, + rmarkdown, + testthat (>= 3.1.9), + usethis, + withr, + knitr, + epinowcast +Encoding: UTF-8 +Roxygen: list(markdown = TRUE) +RoxygenNote: 7.3.2 +VignetteBuilder: knitr From a7bb4a9acd34caade6b3401ec1d254ff4fabba87 Mon Sep 17 00:00:00 2001 From: Kaitlyn Johnson Date: Mon, 27 Jan 2025 16:40:24 +0000 Subject: [PATCH 02/18] first pass set up of some basic infrastructure --- .github/.gitignore | 1 + .github/workflows/R-CMD-check.yaml | 57 +++++++++ .github/workflows/pkgdown.yaml | 54 +++++++++ .github/workflows/render-readme.yaml | 70 +++++++++++ .github/workflows/test-coverage.yaml | 46 +++++++ .gitignore | 23 ++++ .lintr | 16 +++ .pre-commit-config.yaml | 39 ++++++ CITATION.cff | 173 +++++++++++++++++++++++++++ DESCRIPTION | 2 +- LICENSE | 23 +--- LICENSE.md | 21 ++++ NAMESPACE | 2 + R/utils.R | 15 +++ README.Rmd | 129 ++++++++++++++++++++ _pkgdown.yml | 24 ++++ man/dot-extract_function_name.Rd | 24 ++++ tests/testthat.R | 8 ++ tests/testthat/test-utils.R | 3 + vignettes/baselinenowcast.Rmd | 31 +++++ 20 files changed, 739 insertions(+), 22 deletions(-) create mode 100644 .github/.gitignore create mode 100644 .github/workflows/R-CMD-check.yaml create mode 100644 .github/workflows/pkgdown.yaml create mode 100644 .github/workflows/render-readme.yaml create mode 100644 .github/workflows/test-coverage.yaml create mode 100644 .gitignore create mode 100644 .lintr create mode 100644 .pre-commit-config.yaml create mode 100644 CITATION.cff create mode 100644 LICENSE.md create mode 100644 NAMESPACE create mode 100644 R/utils.R create mode 100644 README.Rmd create mode 100644 _pkgdown.yml create mode 100644 man/dot-extract_function_name.Rd create mode 100644 tests/testthat.R create mode 100644 tests/testthat/test-utils.R create mode 100644 vignettes/baselinenowcast.Rmd diff --git a/.github/.gitignore b/.github/.gitignore new file mode 100644 index 0000000..2d19fc7 --- /dev/null +++ b/.github/.gitignore @@ -0,0 +1 @@ +*.html diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml new file mode 100644 index 0000000..da38f96 --- /dev/null +++ b/.github/workflows/R-CMD-check.yaml @@ -0,0 +1,57 @@ +# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag. +# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions +on: + push: + branches: + - main + schedule: + - cron: '5 4 * * 1' + pull_request: + branches: + - main + merge_group: + workflow_dispatch: + +name: R-CMD-check + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + +jobs: + R-CMD-check: + if: "! contains(github.event.head_commit.message, '[ci skip]')" + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + + strategy: + fail-fast: false + matrix: + config: + - {os: ubuntu-latest, r: 'release'} + - {os: ubuntu-latest, r: 'oldrel-1'} + - {os: macOS-latest, r: 'release'} + - {os: windows-latest, r: 'release'} + + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes + NOT_CRAN: true + + steps: + - uses: actions/checkout@v4 + - uses: r-lib/actions/setup-pandoc@v2 + - uses: r-lib/actions/setup-r@v2 + with: + r-version: ${{ matrix.config.r }} + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::rcmdcheck + needs: check + + - uses: r-lib/actions/check-r-package@v2 + with: + upload-snapshots: true diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml new file mode 100644 index 0000000..27bad0b --- /dev/null +++ b/.github/workflows/pkgdown.yaml @@ -0,0 +1,54 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/master/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [main] + workflow_dispatch: + pull_request: + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + +name: pkgdown + +jobs: + pkgdown: + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + extra-repositories: 'https://stan-dev.r-universe.dev' + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::pkgdown, local::. + needs: website + + - name: Build site + run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) + shell: Rscript {0} + + - name: Upload website + uses: actions/upload-artifact@v4 + with: + name: website + retention-days: 5 + path: docs + + - name: Deploy to GitHub pages 🚀 + if: github.event_name != 'pull_request' + uses: JamesIves/github-pages-deploy-action@v4.7.2 + with: + clean: false + branch: gh-pages + folder: docs diff --git a/.github/workflows/render-readme.yaml b/.github/workflows/render-readme.yaml new file mode 100644 index 0000000..6cf86d4 --- /dev/null +++ b/.github/workflows/render-readme.yaml @@ -0,0 +1,70 @@ +name: render-readme + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + +on: + workflow_dispatch: + push: + branches: + - main + +jobs: + render-readme: + runs-on: macos-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + steps: + - name: Checkout repos + uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + extra-repositories: 'https://stan-dev.r-universe.dev' + + - 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::., any::allcontributors, any::spelling + + - name: Update contributors + if: github.ref == 'refs/heads/main' + run: allcontributors::add_contributors(format = "text") + shell: Rscript {0} + + - name: Compile the readme + run: | + rmarkdown::render("README.Rmd") + shell: Rscript {0} + + - name: Upload README.md as an artifact + uses: actions/upload-artifact@v4 + with: + name: readme + path: README.md + + - name: Update the wordlist + run: | + spelling::update_wordlist(confirm = FALSE) + shell: Rscript {0} + + - name: Create Pull Request + if: github.ref == 'refs/heads/main' + uses: peter-evans/create-pull-request@v7 + with: + commit-message: "Automatic README update" + title: "Update README" + body: "This is an automated pull request to update the README." + branch: "update-readme-${{ github.run_number }}" + labels: "documentation" + reviewers: seabbs + add-paths: | + README.Rmd + README.md + inst/WORDLIST + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml new file mode 100644 index 0000000..55ed604 --- /dev/null +++ b/.github/workflows/test-coverage.yaml @@ -0,0 +1,46 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/master/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [main] + pull_request: + branches: [main] + workflow_dispatch: + merge_group: + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + +name: test-coverage + +jobs: + test-coverage: + runs-on: ubuntu-latest + if: "! contains(github.event.head_commit.message, '[ci skip]')" + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + NOT_CRAN: true + + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + extra-repositories: 'https://stan-dev.r-universe.dev' + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::covr + needs: coverage + + - name: Install cmdstan + uses: epinowcast/actions/install-cmdstan@v1 + with: + cmdstan-version: 'latest' + num-cores: 2 + + - name: Test coverage + run: covr::codecov(quiet = FALSE, token = "${{ secrets.CODECOV_TOKEN }}") + shell: Rscript {0} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a3d0602 --- /dev/null +++ b/.gitignore @@ -0,0 +1,23 @@ +*.xlsx +output +*.rds +inst/doc +*.tex +*.log +_targets +docs +cache +.DS_Store +.Rproj.user +*.Rproj +!inst/extdata/*.rds +/doc/ +/Meta/ +*.Rhistory +.vscode +/figures/ +/vignettes/*_cache/ +.here +*.pdf +*.html +CRAN-SUBMISSION diff --git a/.lintr b/.lintr new file mode 100644 index 0000000..fda3d78 --- /dev/null +++ b/.lintr @@ -0,0 +1,16 @@ +linters: all_linters( + packages = "lintr", + implicit_integer_linter = NULL, + extraction_operator_linter = NULL, + undesirable_function_linter = NULL, + function_argument_linter = NULL, + indentation_linter = NULL, + object_name_linter = NULL, + cyclocomp_linter(25L) + ) +exclusions: list( + "inst", + "tests/testthat.R" = list( + unused_import_linter = Inf + ) + ) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..4a228d5 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,39 @@ +# All available hooks: https://pre-commit.com/hooks.html +# R specific hooks: https://github.com/lorenzwalthert/precommit +repos: +- repo: https://github.com/lorenzwalthert/precommit + rev: v0.4.3 + hooks: + - id: style-files + args: [--style_pkg=styler, --style_fun=tidyverse_style] + # codemeta must be above use-tidy-description when both are used + # - id: codemeta-description-updated + - id: use-tidy-description + - id: lintr + - id: parsable-R + - id: no-browser-statement + - id: deps-in-desc +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.6.0 + hooks: + - id: check-added-large-files + args: ['--maxkb=200'] + - id: end-of-file-fixer + exclude: '\.Rd' +- repo: local + hooks: + - id: forbid-to-commit + name: Don't commit common R artifacts + entry: Cannot commit .Rhistory, .RData, .Rds or .rds. + language: fail + files: '\.Rhistory|\.RData|\.Rds|\.rds$' +- repo: meta + hooks: + - id: check-hooks-apply + - id: check-useless-excludes +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.6.0 + hooks: + - id: trailing-whitespace + - id: check-yaml + - id: check-added-large-files diff --git a/CITATION.cff b/CITATION.cff new file mode 100644 index 0000000..4d2f666 --- /dev/null +++ b/CITATION.cff @@ -0,0 +1,173 @@ +# -------------------------------------------- +# CITATION file created with {cffr} R package +# See also: https://docs.ropensci.org/cffr/ +# -------------------------------------------- + +cff-version: 1.2.0 +message: 'To cite package "baselinenowcast" in publications use:' +type: software +license: MIT +title: 'baselinenowcast: Baseline nowcast from right-truncated epidemiological data' +version: 0.1.0.1000 +doi: 10.5281/zenodo.13632839 +identifiers: +- type: url + value: https://github.com/epinowcast/baselinenowcast/ +abstract: This package provides R functions to implement nowcasting from + right-truncated epidemiological case data +authors: +- name: Kaitlyn Johnson + email: kaitlyn.johnson@lshtm.ac.uk + orcid: https://orcid.org/0000-0001-8011-0012 +- name: Sam Abbott + email: contact@samabbott.co.uk + orcid: https://orcid.org/0000-0001-8057-8037 +- name: Sebastian Funk + email: sebastian.funk@lshtm.ac.uk + orcid: https://orcid.org/0000-0002-2842-3406 +- name: Johannes Bracher + email: johannes.bracher@kit.edu + orcid: https://orcid.org/0000-0002-3777-1410 +preferred-citation: + type: manual + title: 'baselinenowcast: Baseline nowcast from right-truncated epidemiological data' + authors: + - name: Kaitlyn Johnson + email: kaitlyn.johnson@lshtm.ac.uk + orcid: https://orcid.org/0000-0001-8011-0012 + - name: Sam Abbott + email: contact@samabbott.co.uk + orcid: https://orcid.org/0000-0001-8057-8037 + - name: Sebastian Funk + email: sebastian.funk@lshtm.ac.uk + orcid: https://orcid.org/0000-0002-2842-3406 + - name: Johannes Bracher + email: johannes.bracher@kit.edu + orcid: https://orcid.org/0000-0002-3777-1410 + year: '2025' +repository-code: https://github.com/epinowcast/baselinenowcast/issues/ +url: https://baselinenowcast.epinowcast.org +contact: +- name: Kaitlyn Johnson + email: kaitlyn.johnson@lshtm.ac.uk + orcid: https://orcid.org/0000-0001-8011-0012 +references: +- type: software + title: 'R: A Language and Environment for Statistical Computing' + notes: Depends + url: https://www.R-project.org/ + authors: + - name: R Core Team + institution: + name: R Foundation for Statistical Computing + address: Vienna, Austria + year: '2024' + version: '>= 4.0.0' +- type: software + title: bookdown + abstract: 'bookdown: Authoring Books and Technical Documents with R Markdown' + notes: Suggests + url: https://pkgs.rstudio.com/bookdown/ + repository: https://CRAN.R-project.org/package=bookdown + authors: + - family-names: Xie + given-names: Yihui + email: xie@yihui.name + orcid: https://orcid.org/0000-0003-0645-5666 + year: '2024' + doi: 10.32614/CRAN.package.bookdown +- type: software + title: knitr + abstract: 'knitr: A General-Purpose Package for Dynamic Report Generation in R' + notes: Suggests + url: https://yihui.org/knitr/ + repository: https://CRAN.R-project.org/package=knitr + authors: + - family-names: Xie + given-names: Yihui + email: xie@yihui.name + orcid: https://orcid.org/0000-0003-0645-5666 + year: '2024' + doi: 10.32614/CRAN.package.knitr +- type: software + title: rmarkdown + abstract: 'rmarkdown: Dynamic Documents for R' + notes: Suggests + url: https://pkgs.rstudio.com/rmarkdown/ + repository: https://CRAN.R-project.org/package=rmarkdown + authors: + - family-names: Allaire + given-names: JJ + email: jj@posit.co + - family-names: Xie + given-names: Yihui + email: xie@yihui.name + orcid: https://orcid.org/0000-0003-0645-5666 + - family-names: Dervieux + given-names: Christophe + email: cderv@posit.co + orcid: https://orcid.org/0000-0003-4474-2498 + - family-names: McPherson + given-names: Jonathan + email: jonathan@posit.co + - family-names: Luraschi + given-names: Javier + - family-names: Ushey + given-names: Kevin + email: kevin@posit.co + - family-names: Atkins + given-names: Aron + email: aron@posit.co + - family-names: Wickham + given-names: Hadley + email: hadley@posit.co + - family-names: Cheng + given-names: Joe + email: joe@posit.co + - family-names: Chang + given-names: Winston + email: winston@posit.co + - family-names: Iannone + given-names: Richard + email: rich@posit.co + orcid: https://orcid.org/0000-0003-3925-190X + year: '2024' + doi: 10.32614/CRAN.package.rmarkdown +- type: software + title: testthat + abstract: 'testthat: Unit Testing for R' + notes: Suggests + url: https://testthat.r-lib.org + repository: https://CRAN.R-project.org/package=testthat + authors: + - family-names: Wickham + given-names: Hadley + email: hadley@posit.co + year: '2024' + doi: 10.32614/CRAN.package.testthat + version: '>= 3.1.9' +- type: software + title: usethis + abstract: 'usethis: Automate Package and Project Setup' + notes: Suggests + url: https://usethis.r-lib.org + repository: https://CRAN.R-project.org/package=usethis + authors: + - family-names: Wickham + given-names: Hadley + email: hadley@posit.co + orcid: https://orcid.org/0000-0003-4757-117X + - family-names: Bryan + given-names: Jennifer + email: jenny@posit.co + orcid: https://orcid.org/0000-0002-6983-2759 + - family-names: Barrett + given-names: Malcolm + email: malcolmbarrett@gmail.com + orcid: https://orcid.org/0000-0003-0299-5825 + - family-names: Teucher + given-names: Andy + email: andy.teucher@posit.co + orcid: https://orcid.org/0000-0002-7840-692X + year: '2024' + doi: 10.32614/CRAN.package.usethis diff --git a/DESCRIPTION b/DESCRIPTION index cb70b5e..23e185d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -22,7 +22,7 @@ Authors@R: email = "sebastian.funk@lshtm.ac.uk", comment = c(ORCID = "0000-0002-2842-3406"))) Description: Provides functions for nowcasting right-truncated epidemiological -data, based hevily on the method implemented in + data, based hevily on the method implemented in https://github.com/KITmetricslab/RESPINOW-Hub/tree/main/code/baseline License: MIT + file LICENSE URL: https://github.com/epinowcast/baselinenowcast/ diff --git a/LICENSE b/LICENSE index 52ae40b..0ef2b33 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,2 @@ -MIT License - -Copyright (c) 2025 Epinowcast - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +YEAR: 2025 +COPYRIGHT HOLDER: baselinenowcast authors \ No newline at end of file diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..1ccc257 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,21 @@ +# MIT License + +Copyright (c) 2025 baselinenowcast authors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/NAMESPACE b/NAMESPACE new file mode 100644 index 0000000..6ae9268 --- /dev/null +++ b/NAMESPACE @@ -0,0 +1,2 @@ +# Generated by roxygen2: do not edit by hand + diff --git a/R/utils.R b/R/utils.R new file mode 100644 index 0000000..d929a70 --- /dev/null +++ b/R/utils.R @@ -0,0 +1,15 @@ +#' Extract Base Function Name +#' Adopted from https://github.com/epinowcast/primarycensored/blob/04f3ff2e5c8741c1f6e003566c68bbaf491cb073/R/utils.R#L11 #nolint +#' This helper function extracts the base name of a function, removing an +#' namespace prefixes. +#' +#' @param func The output of `substitute` on a function. +#' +#' @return A character string representing the base name of the function. +#' +#' @keywords internal +.extract_function_name <- function(func) { + func_name <- deparse(func) + base_name <- sub("^.*::", "", func_name) + return(base_name) +} \ No newline at end of file diff --git a/README.Rmd b/README.Rmd new file mode 100644 index 0000000..1a38d53 --- /dev/null +++ b/README.Rmd @@ -0,0 +1,129 @@ +--- +output: github_document +--- + + +```{r, include = FALSE} +knitr::opts_chunk$set( + collapse = TRUE, + comment = "", + fig.path = file.path("man", "figures", "README-"), + out.width = "100%", + dpi = 330, + message = FALSE, warning = FALSE +) +``` +# Primary event censored distributions primarycensored website + + +[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable) +[![R-CMD-check](https://github.com/epinowcast/primarycensored/workflows/R-CMD-check/badge.svg)](https://github.com/epinowcast/baselinenowcast/actions/workflows/R-CMD-check.yaml) [![Codecov test coverage](https://codecov.io/gh/epinowcast/baselinenowcast/branch/main/graph/badge.svg)](https://app.codecov.io/gh/epinowcast/baselinenowcast) + +[![Universe](https://epinowcast.r-universe.dev/badges/primarycensored)](https://epinowcast.r-universe.dev/baselinenowcast) +[![MIT +license](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/epinowcast/baselinenowcast/blob/master/LICENSE.md/) +[![GitHub contributors](https://img.shields.io/github/contributors/epinowcast/baselinenowcast)](https://github.com/epinowcast/baselinenowcast/graphs/contributors) + + +## Summary + +```{r, results = "asis", echo=FALSE} +cat(gsub("\n[ ]+", " ", packageDescription("baselinenowcast")$Description)) +``` + +## Installation + +
Installing the package + +```{r, child="vignettes/chunks/_readme-install-baselinenowcast.Rmd"} +``` + + +## Resources + +We provide a range of other documentation, case studies, and community spaces to ask (and answer!) questions: + +
Package Website + +The [`baselinenowcast` website](https://baselinenowcast.epinowcast.org/) will include a function reference and case studies using the package. + +
+ +
Organisation Website + +Our [organisation website](https://www.epinowcast.org/) includes links to other resources, [guest posts](https://www.epinowcast.org/blog.html), and [seminar schedule](https://www.epinowcast.org/seminars.html) for both upcoming and past recordings. + +
+ +
Community Forum + +Our [community forum](https://community.epinowcast.org/) has areas for [question and answer](https://community.epinowcast.org/c/interface/15) and [considering new methods and tools](https://community.epinowcast.org/c/projects/11), among others. If you are generally interested in real-time analysis of infectious disease, you may find this useful even if you do not use `baselinenowcast`. + +
+ +## Contributing + +We welcome contributions and new contributors! We particularly appreciate help on [identifying and identified issues](https://github.com/epinowcast/baselinenowcast/issues). Please check and add to the issues, and/or add a [pull request](https://github.com/epinowcast/baselinenowcast/pulls) and see our [contributing guide](https://github.com/epinowcast/.github/blob/main/CONTRIBUTING.md) for more information. + + +### How to make a bug report or feature request + +Please briefly describe your problem and what output you expect in an [issue](https://github.com/epinowcast/baselinenowcast/issues). See our [contributing guide](https://github.com/epinowcast/.github/blob/main/CONTRIBUTING.md) for more information. + +### Code of Conduct + +Please note that the `baselinenowcast` project is released with a [Contributor Code of Conduct](https://github.com/epinowcast/.github/blob/main/CODE_OF_CONDUCT.md). By contributing to this project, you agree to abide by its terms. + +## Citation + +If you use `baselinenowcast` in your work, please consider citing it with `citation("baselinenowcast")`. + +## Contributors + + + + + + + + + + + + + + + + + +All contributions to this project are gratefully acknowledged using the [`allcontributors` package](https://github.com/ropensci/allcontributors) following the [all-contributors](https://allcontributors.org) specification. Contributions of any kind are welcome! + +### Code + + +seabbs, +SamuelBrand1, +sbfnk, +athowes + + + +### Issue Authors + + +zsusswein, +jcblemai, +jamesmbaazam + + + +### Issue Contributors + + +parksw3 + + + + + + diff --git a/_pkgdown.yml b/_pkgdown.yml new file mode 100644 index 0000000..a0f1ec8 --- /dev/null +++ b/_pkgdown.yml @@ -0,0 +1,24 @@ +url: https://baselinenowcast.epinowcast.org/ +template: + package: enwtheme + math-rendering: mathjax + +development: + mode: auto + +navbar: + structure: + right: [search, github, lightswitch] + components: + +home: + title: Baseline nowcast for right-truncated epidemiological data + + + + + + + + + diff --git a/man/dot-extract_function_name.Rd b/man/dot-extract_function_name.Rd new file mode 100644 index 0000000..39a5a6f --- /dev/null +++ b/man/dot-extract_function_name.Rd @@ -0,0 +1,24 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/utils.R +\name{.extract_function_name} +\alias{.extract_function_name} +\title{Extract Base Function Name +Adopted from https://github.com/epinowcast/primarycensored/blob/04f3ff2e5c8741c1f6e003566c68bbaf491cb073/R/utils.R#L11 #nolint +This helper function extracts the base name of a function, removing an +namespace prefixes.} +\usage{ +.extract_function_name(func) +} +\arguments{ +\item{func}{The output of \code{substitute} on a function.} +} +\value{ +A character string representing the base name of the function. +} +\description{ +Extract Base Function Name +Adopted from https://github.com/epinowcast/primarycensored/blob/04f3ff2e5c8741c1f6e003566c68bbaf491cb073/R/utils.R#L11 #nolint +This helper function extracts the base name of a function, removing an +namespace prefixes. +} +\keyword{internal} diff --git a/tests/testthat.R b/tests/testthat.R new file mode 100644 index 0000000..1c639cd --- /dev/null +++ b/tests/testthat.R @@ -0,0 +1,8 @@ +library(testthat) +library(baselinenowcast) + +test_results <- test_check("baselinenowcast") + +if (any(as.data.frame(test_results)$warning > 0)) { + stop("tests failed with warnings") +} \ No newline at end of file diff --git a/tests/testthat/test-utils.R b/tests/testthat/test-utils.R new file mode 100644 index 0000000..d1f030f --- /dev/null +++ b/tests/testthat/test-utils.R @@ -0,0 +1,3 @@ +test_that("function name is returned", { +expect_identical(1, 1) +}) \ No newline at end of file diff --git a/vignettes/baselinenowcast.Rmd b/vignettes/baselinenowcast.Rmd new file mode 100644 index 0000000..63b80e3 --- /dev/null +++ b/vignettes/baselinenowcast.Rmd @@ -0,0 +1,31 @@ + +--- +title: "Getting Started with baselinenowcast" +description: "A quick start example demonstrating use of baselinenowcast" +author: Kaitlyn Johnson +output: + bookdown::html_document2: + fig_caption: yes + code_folding: show +pkgdown: + as_is: true +bibliography: library.bib +csl: https://raw.githubusercontent.com/citation-style-language/styles/master/apa-numeric-superscript-brackets.csl +link-citations: true +vignette: > + %\VignetteIndexEntry{Getting Started with baselinenowcast} + %\VignetteEngine{knitr::rmarkdown} + %\VignetteEncoding{UTF-8} +--- + +# Introduction + + + +```{r setup, message = FALSE} +# Load packages +library(baselinenowcast) +library(ggplot2) +# Set seed for reproducibility +set.seed(123) +``` \ No newline at end of file From 62d434657e7e0d5d8888069790bcda9f3e26977b Mon Sep 17 00:00:00 2001 From: Kaitlyn Johnson <94390107+kaitejohnson@users.noreply.github.com> Date: Mon, 27 Jan 2025 16:42:46 +0000 Subject: [PATCH 03/18] test add action to render readme --- .github/workflows/render-readme.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/render-readme.yaml b/.github/workflows/render-readme.yaml index 6cf86d4..afe79ca 100644 --- a/.github/workflows/render-readme.yaml +++ b/.github/workflows/render-readme.yaml @@ -9,6 +9,7 @@ on: push: branches: - main + - add-skeleton-from-primary-censored jobs: render-readme: From 200277e1922203c2bd8f1d597097c04bd2d344ab Mon Sep 17 00:00:00 2001 From: Kaitlyn Johnson Date: Mon, 27 Jan 2025 17:14:41 +0000 Subject: [PATCH 04/18] try removing other dependencies --- .github/workflows/render-readme.yaml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/render-readme.yaml b/.github/workflows/render-readme.yaml index 6cf86d4..d16fb70 100644 --- a/.github/workflows/render-readme.yaml +++ b/.github/workflows/render-readme.yaml @@ -30,7 +30,7 @@ jobs: - name: Install dependencies uses: r-lib/actions/setup-r-dependencies@v2 with: - extra-packages: any::rmarkdown, local::., any::allcontributors, any::spelling + extra-packages: any::rmarkdown - name: Update contributors if: github.ref == 'refs/heads/main' @@ -48,11 +48,6 @@ jobs: name: readme path: README.md - - name: Update the wordlist - run: | - spelling::update_wordlist(confirm = FALSE) - shell: Rscript {0} - - name: Create Pull Request if: github.ref == 'refs/heads/main' uses: peter-evans/create-pull-request@v7 From 85428897f2461c97a3106ef4838a556bb08714ac Mon Sep 17 00:00:00 2001 From: Kaitlyn Johnson <94390107+kaitejohnson@users.noreply.github.com> Date: Tue, 28 Jan 2025 09:12:17 +0000 Subject: [PATCH 05/18] remove epinowcast from suggests for now --- DESCRIPTION | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 23e185d..4af83c1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -23,7 +23,7 @@ Authors@R: comment = c(ORCID = "0000-0002-2842-3406"))) Description: Provides functions for nowcasting right-truncated epidemiological data, based hevily on the method implemented in -https://github.com/KITmetricslab/RESPINOW-Hub/tree/main/code/baseline + https://github.com/KITmetricslab/RESPINOW-Hub/tree/main/code/baseline License: MIT + file LICENSE URL: https://github.com/epinowcast/baselinenowcast/ BugReports: https://github.com/epinowcast/baselinenowcast/issues @@ -36,8 +36,7 @@ Suggests: testthat (>= 3.1.9), usethis, withr, - knitr, - epinowcast + knitr Encoding: UTF-8 Roxygen: list(markdown = TRUE) RoxygenNote: 7.3.2 From da2e50f7a2ca001d814d935805e03db2bfbe760c Mon Sep 17 00:00:00 2001 From: Kaitlyn Johnson Date: Tue, 28 Jan 2025 09:14:27 +0000 Subject: [PATCH 06/18] remove enw_theme --- _pkgdown.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/_pkgdown.yml b/_pkgdown.yml index a0f1ec8..27c2b57 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -1,6 +1,5 @@ url: https://baselinenowcast.epinowcast.org/ template: - package: enwtheme math-rendering: mathjax development: From 89ddb9e3daf0044da86db211eb4c85333d182095 Mon Sep 17 00:00:00 2001 From: Kaitlyn Johnson Date: Tue, 28 Jan 2025 09:28:14 +0000 Subject: [PATCH 07/18] fix README.Rmd to barebones empty readme --- DESCRIPTION | 2 +- README.Rmd | 55 ++----------------- .../_readme-install-baselinenowcast.Rmd | 9 +++ 3 files changed, 14 insertions(+), 52 deletions(-) create mode 100644 vignettes/chunks/_readme-install-baselinenowcast.Rmd diff --git a/DESCRIPTION b/DESCRIPTION index 4af83c1..9448cfe 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -22,7 +22,7 @@ Authors@R: email = "sebastian.funk@lshtm.ac.uk", comment = c(ORCID = "0000-0002-2842-3406"))) Description: Provides functions for nowcasting right-truncated epidemiological - data, based hevily on the method implemented in + data, based heavily on the method implemented in https://github.com/KITmetricslab/RESPINOW-Hub/tree/main/code/baseline License: MIT + file LICENSE URL: https://github.com/epinowcast/baselinenowcast/ diff --git a/README.Rmd b/README.Rmd index 1a38d53..f8a9b80 100644 --- a/README.Rmd +++ b/README.Rmd @@ -12,8 +12,9 @@ knitr::opts_chunk$set( dpi = 330, message = FALSE, warning = FALSE ) + ``` -# Primary event censored distributions primarycensored website +# Baseline nowcast [![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable) @@ -38,17 +39,12 @@ cat(gsub("\n[ ]+", " ", packageDescription("baselinenowcast")$Description)) ```{r, child="vignettes/chunks/_readme-install-baselinenowcast.Rmd"} ``` +
## Resources We provide a range of other documentation, case studies, and community spaces to ask (and answer!) questions: -
Package Website - -The [`baselinenowcast` website](https://baselinenowcast.epinowcast.org/) will include a function reference and case studies using the package. - -
-
Organisation Website Our [organisation website](https://www.epinowcast.org/) includes links to other resources, [guest posts](https://www.epinowcast.org/blog.html), and [seminar schedule](https://www.epinowcast.org/seminars.html) for both upcoming and past recordings. @@ -80,50 +76,7 @@ If you use `baselinenowcast` in your work, please consider citing it with `citat ## Contributors + - - - - - - - - - - - - - -All contributions to this project are gratefully acknowledged using the [`allcontributors` package](https://github.com/ropensci/allcontributors) following the [all-contributors](https://allcontributors.org) specification. Contributions of any kind are welcome! - -### Code - - -seabbs, -SamuelBrand1, -sbfnk, -athowes - - - -### Issue Authors - - -zsusswein, -jcblemai, -jamesmbaazam - - - -### Issue Contributors - - -parksw3 - - - - - - diff --git a/vignettes/chunks/_readme-install-baselinenowcast.Rmd b/vignettes/chunks/_readme-install-baselinenowcast.Rmd new file mode 100644 index 0000000..5c59a30 --- /dev/null +++ b/vignettes/chunks/_readme-install-baselinenowcast.Rmd @@ -0,0 +1,9 @@ + +To install the development version from GitHub (warning! this version may contain breaking changes and/or bugs), use the [`pak` package](https://pak.r-lib.org/): + +```{r, eval = FALSE} +pak::pak("epinowcast/baselinenowcast") +``` + + +*Note: You can also use the above approach to install a specific commit if needed, for example, if you want to try out a specific unreleased feature, but not the absolute latest developmental version.* From 3a436a8d0dff25c8eaad4996de71a03d01c3ba9d Mon Sep 17 00:00:00 2001 From: Kaitlyn Johnson Date: Tue, 28 Jan 2025 09:39:03 +0000 Subject: [PATCH 08/18] add local install --- .github/workflows/render-readme.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/render-readme.yaml b/.github/workflows/render-readme.yaml index d484f5c..d0d5a5f 100644 --- a/.github/workflows/render-readme.yaml +++ b/.github/workflows/render-readme.yaml @@ -31,7 +31,7 @@ jobs: - name: Install dependencies uses: r-lib/actions/setup-r-dependencies@v2 with: - extra-packages: any::rmarkdown + extra-packages: any::rmarkdown, local::. - name: Update contributors if: github.ref == 'refs/heads/main' From 8af79406ca1ee2bf06a7ff4a5756d090b663595a Mon Sep 17 00:00:00 2001 From: Kaitlyn Johnson <94390107+kaitejohnson@users.noreply.github.com> Date: Tue, 28 Jan 2025 09:46:27 +0000 Subject: [PATCH 09/18] remove test to branch for GHA --- .github/workflows/render-readme.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/render-readme.yaml b/.github/workflows/render-readme.yaml index d0d5a5f..7c75d22 100644 --- a/.github/workflows/render-readme.yaml +++ b/.github/workflows/render-readme.yaml @@ -9,7 +9,6 @@ on: push: branches: - main - - add-skeleton-from-primary-censored jobs: render-readme: From a50d97264dd5ea76651328eb14b4c0b6378b0cac Mon Sep 17 00:00:00 2001 From: Kaitlyn Johnson Date: Tue, 28 Jan 2025 10:08:27 +0000 Subject: [PATCH 10/18] add in more CI, spelling, changelog, linting --- .github/workflows/R-CMD-as-cran-check.yaml | 47 +++++++++ .github/workflows/R-CMD-check.yaml | 2 +- .github/workflows/codemeta.yaml | 45 +++++++++ .github/workflows/lint-changed-files.yaml | 50 ++++++++++ .github/workflows/pkgdown.yaml | 2 +- .github/workflows/pr-commands.yaml | 110 +++++++++++++++++++++ .github/workflows/render-readme.yaml | 4 +- .github/workflows/update-citation-cff.yaml | 62 ++++++++++++ CITATION.cff | 2 +- DESCRIPTION | 5 +- LICENSE | 2 +- NAMESPACE | 1 - NEWS.md | 3 + R/utils.R | 2 +- README.Rmd | 6 +- _pkgdown.yml | 11 +-- inst/WORDLIST | 13 +++ tests/spelling.R | 6 ++ tests/testthat.R | 3 +- tests/testthat/test-utils.R | 4 +- vignettes/baselinenowcast.Rmd | 2 +- 21 files changed, 354 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/R-CMD-as-cran-check.yaml create mode 100644 .github/workflows/codemeta.yaml create mode 100644 .github/workflows/lint-changed-files.yaml create mode 100644 .github/workflows/pr-commands.yaml create mode 100644 .github/workflows/update-citation-cff.yaml create mode 100644 NEWS.md create mode 100644 inst/WORDLIST create mode 100644 tests/spelling.R diff --git a/.github/workflows/R-CMD-as-cran-check.yaml b/.github/workflows/R-CMD-as-cran-check.yaml new file mode 100644 index 0000000..b80d584 --- /dev/null +++ b/.github/workflows/R-CMD-as-cran-check.yaml @@ -0,0 +1,47 @@ +# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag. +# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions +on: + push: + branches: + - main + schedule: + - cron: '5 4 * * 1' + pull_request: + branches: + - main + merge_group: + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + +name: R-CMD-as-cran-check + +jobs: + R-CMD-as-cran-check: + if: "! contains(github.event.head_commit.message, '[ci skip]')" + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + NOT_CRAN: false + + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 + with: + dependencies: '"hard"' + use-public-rspm: true + extra-repositories: 'https://stan-dev.r-universe.dev' + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::rcmdcheck + needs: check + + - uses: r-lib/actions/check-r-package@v2 + with: + upload-snapshots: true diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index da38f96..991bda2 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -40,7 +40,7 @@ jobs: NOT_CRAN: true steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-pandoc@v2 - uses: r-lib/actions/setup-r@v2 with: diff --git a/.github/workflows/codemeta.yaml b/.github/workflows/codemeta.yaml new file mode 100644 index 0000000..0c41148 --- /dev/null +++ b/.github/workflows/codemeta.yaml @@ -0,0 +1,45 @@ +on: + push: + paths: + - DESCRIPTION + - .github/workflows/codemeta.yml + workflow_dispatch: + +name: Render codemeta + +jobs: + render: + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, 'cm-skip')" + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + extra-repositories: 'https://stan-dev.r-universe.dev' + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::codemetar + needs: codemeta + + - name: Render codemeta + run: codemetar::write_codemeta() + shell: Rscript {0} + + - name: Create Pull Request + if: github.ref == 'refs/heads/main' + uses: peter-evans/create-pull-request@v7 + with: + commit-message: "Update codemeta.json" + title: "Update codemeta.json" + body: "This is an automated pull request to update the codemeta.json file." + branch: "update-codemeta-${{ github.run_number }}" + labels: "metadata" + reviewers: seabbs + add-paths: | + codemeta.json + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/lint-changed-files.yaml b/.github/workflows/lint-changed-files.yaml new file mode 100644 index 0000000..36c6e2e --- /dev/null +++ b/.github/workflows/lint-changed-files.yaml @@ -0,0 +1,50 @@ +# 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 +on: + pull_request: + branches: + - main + workflow_dispatch: + +name: lint-changed-files + +jobs: + lint-changed-files: + runs-on: ubuntu-latest + if: "! contains(github.event.head_commit.message, '[ci skip]')" + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + extra-repositories: 'https://stan-dev.r-universe.dev' + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: | + any::gh + any::lintr + any::purrr + needs: check + + - name: Add lintr options + run: | + cat('\noptions(lintr.linter_file = ".lintr")\n', file = "~/.Rprofile", append = TRUE) + shell: Rscript {0} + + - name: Install package + run: R CMD INSTALL . + + - name: Extract and lint files changed by this PR + run: | + files <- gh::gh("GET https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files") + changed_files <- purrr::map_chr(files, "filename") + all_files <- list.files(recursive = TRUE) + exclusions_list <- as.list(setdiff(all_files, changed_files)) + lintr::lint_package(exclusions = exclusions_list) + shell: Rscript {0} + env: + LINTR_ERROR_ON_LINT: true diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 27bad0b..5ca6088 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -27,7 +27,7 @@ jobs: - uses: r-lib/actions/setup-r@v2 with: use-public-rspm: true - extra-repositories: 'https://stan-dev.r-universe.dev' + extra-repositories: 'https://stan-dev.r-universe.dev' - uses: r-lib/actions/setup-r-dependencies@v2 with: diff --git a/.github/workflows/pr-commands.yaml b/.github/workflows/pr-commands.yaml new file mode 100644 index 0000000..fd5ccd8 --- /dev/null +++ b/.github/workflows/pr-commands.yaml @@ -0,0 +1,110 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/master/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + issue_comment: + types: [created] + +name: Commands + +jobs: + document: + if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER' || github.event.comment.author_association == 'COLLABORATOR') && startsWith(github.event.comment.body, '/document') }} + name: document + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/pr-fetch@v2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + extra-repositories: 'https://stan-dev.r-universe.dev' + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: roxygen2 + + - name: Document + run: Rscript -e 'roxygen2::roxygenise()' + + - name: commit + run: | + git config --local user.name "$GITHUB_ACTOR" + git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" + git add man/\* NAMESPACE + git commit -m 'Document' + - uses: r-lib/actions/pr-push@v2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + + style: + if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER' || github.event.comment.author_association == 'COLLABORATOR') && startsWith(github.event.comment.body, '/style') }} + name: style + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/pr-fetch@v2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + + - uses: r-lib/actions/setup-r@v2 + + - name: Install dependencies + run: Rscript -e 'install.packages(c("styler", "roxygen2"))' + + - name: Style + run: Rscript -e 'styler::style_pkg()' + + - name: commit + run: | + git config --local user.name "$GITHUB_ACTOR" + git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" + git add \*.R + git commit -m 'Style' + - uses: r-lib/actions/pr-push@v2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + + update_wordlist: + if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER' || github.event.comment.author_association == 'COLLABORATOR') && startsWith(github.event.comment.body, '/update_wordlist') }} + name: update_wordlist + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/pr-fetch@v2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + + - uses: r-lib/actions/setup-r@v2 + + - name: Install dependencies + run: | + install.packages(c("spelling")) + shell: Rscript {0} + + - name: Update wordlist + run: | + spelling::update_wordlist(confirm = TRUE) + shell: Rscript {0} + + - name: Commit changes + run: | + git config --local user.name "$GITHUB_ACTOR" + git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" + git add inst/WORDLIST + git commit -m 'Update wordlist' || echo "No changes to commit" + + - uses: r-lib/actions/pr-push@v2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/render-readme.yaml b/.github/workflows/render-readme.yaml index d0d5a5f..6836411 100644 --- a/.github/workflows/render-readme.yaml +++ b/.github/workflows/render-readme.yaml @@ -23,7 +23,7 @@ jobs: - uses: r-lib/actions/setup-r@v2 with: use-public-rspm: true - extra-repositories: 'https://stan-dev.r-universe.dev' + extra-repositories: 'https://stan-dev.r-universe.dev' - name: Setup pandoc uses: r-lib/actions/setup-pandoc@v2 @@ -58,7 +58,7 @@ jobs: body: "This is an automated pull request to update the README." branch: "update-readme-${{ github.run_number }}" labels: "documentation" - reviewers: seabbs + reviewers: kaitejohnson add-paths: | README.Rmd README.md diff --git a/.github/workflows/update-citation-cff.yaml b/.github/workflows/update-citation-cff.yaml new file mode 100644 index 0000000..5a682eb --- /dev/null +++ b/.github/workflows/update-citation-cff.yaml @@ -0,0 +1,62 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/master/examples +# The action runs when: +# - A new release is published +# - The DESCRIPTION or inst/CITATION are modified +# - Can be run manually +# For customizing the triggers, visit https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows +on: + push: + tags-ignore: + - '*' + paths: + - DESCRIPTION + - inst/CITATION + - .github/workflows/update-citation-cff.yaml + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + +name: Update CITATION.cff + +jobs: + update-citation-cff: + runs-on: macos-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v4 + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + extra-repositories: 'https://stan-dev.r-universe.dev' + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: | + any::cffr + any::V8 + - name: Update CITATION.cff + run: | + library(cffr) + # Customize with your own code + # See https://docs.ropensci.org/cffr/articles/cffr.html + # Write your own keys + mykeys <- list() + # Create your CITATION.cff file + cff_write(keys = mykeys) + shell: Rscript {0} + + - name: Create Pull Request + if: github.ref == 'refs/heads/main' + uses: peter-evans/create-pull-request@v7 + with: + commit-message: "Update CITATION.cff" + title: "Update CITATION.cff" + body: "This is an automated pull request to update the CITATION.cff file." + branch: "update-citation-cff-${{ github.run_number }}" + labels: "documentation" + reviewers: seabbs + add-paths: | + CITATION.cff + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/CITATION.cff b/CITATION.cff index 4d2f666..5d12fd7 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -13,7 +13,7 @@ doi: 10.5281/zenodo.13632839 identifiers: - type: url value: https://github.com/epinowcast/baselinenowcast/ -abstract: This package provides R functions to implement nowcasting from +abstract: This package provides R functions to implement nowcasting from right-truncated epidemiological case data authors: - name: Kaitlyn Johnson diff --git a/DESCRIPTION b/DESCRIPTION index 9448cfe..7470820 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -22,16 +22,19 @@ Authors@R: email = "sebastian.funk@lshtm.ac.uk", comment = c(ORCID = "0000-0002-2842-3406"))) Description: Provides functions for nowcasting right-truncated epidemiological - data, based heavily on the method implemented in + data, based heavily on the method implemented in https://github.com/KITmetricslab/RESPINOW-Hub/tree/main/code/baseline License: MIT + file LICENSE URL: https://github.com/epinowcast/baselinenowcast/ BugReports: https://github.com/epinowcast/baselinenowcast/issues Depends: R (>= 4.0.0) +Imports: + spelling (>= 2.3.0) Suggests: dplyr, ggplot2, + spelling, rmarkdown, testthat (>= 3.1.9), usethis, diff --git a/LICENSE b/LICENSE index 0ef2b33..b81dba3 100644 --- a/LICENSE +++ b/LICENSE @@ -1,2 +1,2 @@ YEAR: 2025 -COPYRIGHT HOLDER: baselinenowcast authors \ No newline at end of file +COPYRIGHT HOLDER: baselinenowcast authors diff --git a/NAMESPACE b/NAMESPACE index 6ae9268..e651b94 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,2 +1 @@ # Generated by roxygen2: do not edit by hand - diff --git a/NEWS.md b/NEWS.md new file mode 100644 index 0000000..ff5cad9 --- /dev/null +++ b/NEWS.md @@ -0,0 +1,3 @@ +# baselinenowcast 0.0.0.100 + +- Added package skeleton. diff --git a/R/utils.R b/R/utils.R index d929a70..e1bc267 100644 --- a/R/utils.R +++ b/R/utils.R @@ -12,4 +12,4 @@ func_name <- deparse(func) base_name <- sub("^.*::", "", func_name) return(base_name) -} \ No newline at end of file +} diff --git a/README.Rmd b/README.Rmd index f8a9b80..a49e9d6 100644 --- a/README.Rmd +++ b/README.Rmd @@ -12,9 +12,8 @@ knitr::opts_chunk$set( dpi = 330, message = FALSE, warning = FALSE ) - ``` -# Baseline nowcast +# Baseline nowcast [![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable) @@ -77,6 +76,3 @@ If you use `baselinenowcast` in your work, please consider citing it with `citat ## Contributors - - - diff --git a/_pkgdown.yml b/_pkgdown.yml index 27c2b57..d983d4a 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -9,15 +9,6 @@ navbar: structure: right: [search, github, lightswitch] components: - + home: title: Baseline nowcast for right-truncated epidemiological data - - - - - - - - - diff --git a/inst/WORDLIST b/inst/WORDLIST new file mode 100644 index 0000000..a76adc5 --- /dev/null +++ b/inst/WORDLIST @@ -0,0 +1,13 @@ +CMD +Codecov +Inf +Lifecycle +PMF +PMFs +dist +etc +func +modeling +rgamma +rnorm +nowcast diff --git a/tests/spelling.R b/tests/spelling.R new file mode 100644 index 0000000..13f77d9 --- /dev/null +++ b/tests/spelling.R @@ -0,0 +1,6 @@ +if (requireNamespace("spelling", quietly = TRUE)) { + spelling::spell_check_test( + vignettes = TRUE, error = FALSE, + skip_on_cran = TRUE + ) +} diff --git a/tests/testthat.R b/tests/testthat.R index 1c639cd..484df2d 100644 --- a/tests/testthat.R +++ b/tests/testthat.R @@ -1,8 +1,9 @@ library(testthat) +library(withr) library(baselinenowcast) test_results <- test_check("baselinenowcast") if (any(as.data.frame(test_results)$warning > 0)) { stop("tests failed with warnings") -} \ No newline at end of file +} diff --git a/tests/testthat/test-utils.R b/tests/testthat/test-utils.R index d1f030f..0253f54 100644 --- a/tests/testthat/test-utils.R +++ b/tests/testthat/test-utils.R @@ -1,3 +1,3 @@ test_that("function name is returned", { -expect_identical(1, 1) -}) \ No newline at end of file + expect_identical(1, 1) +}) diff --git a/vignettes/baselinenowcast.Rmd b/vignettes/baselinenowcast.Rmd index 63b80e3..5f56e16 100644 --- a/vignettes/baselinenowcast.Rmd +++ b/vignettes/baselinenowcast.Rmd @@ -28,4 +28,4 @@ library(baselinenowcast) library(ggplot2) # Set seed for reproducibility set.seed(123) -``` \ No newline at end of file +``` From 39952950f4f624b6ca0d8d4702a94036e5688049 Mon Sep 17 00:00:00 2001 From: Kaitlyn Johnson Date: Tue, 28 Jan 2025 10:14:13 +0000 Subject: [PATCH 11/18] add bookdown, add .Rbuildignore --- .Rbuildignore | 27 +++++++++++++++++++++++++++ DESCRIPTION | 1 + 2 files changed, 28 insertions(+) create mode 100644 .Rbuildignore diff --git a/.Rbuildignore b/.Rbuildignore new file mode 100644 index 0000000..b423ff3 --- /dev/null +++ b/.Rbuildignore @@ -0,0 +1,27 @@ +^LICENSE\.md$ +^\.devcontainer$ +^data-raw$ +^README\.Rmd$ +^\.github$ +^\.pre-commit-config\.yaml$ +^\.lintr$ +^\.Rprofile +^_pkgdown\.yml$ +^docs$ +^pkgdown$ +^vignettes/cache$ +^.*\.Rproj$ +^\.Rproj\.user$ +^codemeta\.json$ +^inst/make_hexsticker\.R$ +^inst/scripts$ +^vignettes/precompile\.R$ +^vignettes/chunks$ +^doc$ +^Meta$ +^\.vscode$ +^CITATION\.cff$ +^vignettes/using-stan-tools\.Rmd$ +^touchstone$ +^cran-comments\.md$ +^CRAN-SUBMISSION$ diff --git a/DESCRIPTION b/DESCRIPTION index 7470820..f18143c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -33,6 +33,7 @@ Imports: spelling (>= 2.3.0) Suggests: dplyr, + bookdown, ggplot2, spelling, rmarkdown, From 83c2677ee9e309ca9a5b6810a7d858f2bf4657c8 Mon Sep 17 00:00:00 2001 From: Kaitlyn Johnson Date: Tue, 28 Jan 2025 10:29:23 +0000 Subject: [PATCH 12/18] replace placeholder test with real test --- R/utils.R | 18 ++++++------------ tests/testthat/test-utils.R | 5 +++-- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/R/utils.R b/R/utils.R index e1bc267..93acb93 100644 --- a/R/utils.R +++ b/R/utils.R @@ -1,15 +1,9 @@ -#' Extract Base Function Name -#' Adopted from https://github.com/epinowcast/primarycensored/blob/04f3ff2e5c8741c1f6e003566c68bbaf491cb073/R/utils.R#L11 #nolint -#' This helper function extracts the base name of a function, removing an -#' namespace prefixes. +#' Escape brackets returned in a string for passing to glue #' -#' @param func The output of `substitute` on a function. +#' @param string A string vector containing `{}` #' -#' @return A character string representing the base name of the function. -#' -#' @keywords internal -.extract_function_name <- function(func) { - func_name <- deparse(func) - base_name <- sub("^.*::", "", func_name) - return(base_name) +#' @return A string vector where all single brackets are replaced with double +#' brackets +autoescape_brackets <- function(string) { + return(gsub("\\{|\\}", "", string)) } diff --git a/tests/testthat/test-utils.R b/tests/testthat/test-utils.R index 0253f54..441f328 100644 --- a/tests/testthat/test-utils.R +++ b/tests/testthat/test-utils.R @@ -1,3 +1,4 @@ -test_that("function name is returned", { - expect_identical(1, 1) +test_that("string is returned without brackets", { + new_string <- autoescape_brackets("This string has {brackets}") + expect_identical(new_string, "This string has brackets") }) From ad6d4d32559ec6a8386426d632bd527da089fda5 Mon Sep 17 00:00:00 2001 From: Kaitlyn Johnson Date: Tue, 28 Jan 2025 10:51:38 +0000 Subject: [PATCH 13/18] add bibliography and fix filepath --- vignettes/baselinenowcast.Rmd | 4 ++-- .../chunks/_readme-install-baselinenowcast.Rmd | 2 +- vignettes/chunks/library.bib | 14 ++++++++++++++ 3 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 vignettes/chunks/library.bib diff --git a/vignettes/baselinenowcast.Rmd b/vignettes/baselinenowcast.Rmd index 5f56e16..8bb2a5f 100644 --- a/vignettes/baselinenowcast.Rmd +++ b/vignettes/baselinenowcast.Rmd @@ -24,8 +24,8 @@ vignette: > ```{r setup, message = FALSE} # Load packages -library(baselinenowcast) -library(ggplot2) +library(baselinenowcast) # nolint +library(ggplot2) # nolint # Set seed for reproducibility set.seed(123) ``` diff --git a/vignettes/chunks/_readme-install-baselinenowcast.Rmd b/vignettes/chunks/_readme-install-baselinenowcast.Rmd index 5c59a30..ec3a4bc 100644 --- a/vignettes/chunks/_readme-install-baselinenowcast.Rmd +++ b/vignettes/chunks/_readme-install-baselinenowcast.Rmd @@ -2,7 +2,7 @@ To install the development version from GitHub (warning! this version may contain breaking changes and/or bugs), use the [`pak` package](https://pak.r-lib.org/): ```{r, eval = FALSE} -pak::pak("epinowcast/baselinenowcast") +pak::pak(file.path("epinowcast", "baselinenowcast")) ``` diff --git a/vignettes/chunks/library.bib b/vignettes/chunks/library.bib new file mode 100644 index 0000000..3939d3e --- /dev/null +++ b/vignettes/chunks/library.bib @@ -0,0 +1,14 @@ +@article{Wolffram2023, + doi = {10.1371/journal.pcbi.1011394}, + author = {Wolffram, Daniel and Abbott, Sam and an der Heiden, Matthias and Funk, Sebastian and Günther, Felix and Hailer, Davide and Heyder, Stefan and Hotz, Thomas and van de Kassteele, Jan and Küchenhoff, Helmut and Müller-Hansen, Sören and Syliqi, Diellë and Ullrich, Alexander and Weigert, Maximilian and Schienle, Melanie and Bracher, Johannes}, + journal = {PLOS Computational Biology}, + publisher = {Public Library of Science}, + title = {Collaborative nowcasting of COVID-19 hospitalization incidences in Germany}, + year = {2023}, + month = {08}, + volume = {19}, + url = {https://doi.org/10.1371/journal.pcbi.1011394}, + pages = {1-25}, + number = {8}, + +} From 9a35107aab40c0c74008730ea3435e3c042afe62 Mon Sep 17 00:00:00 2001 From: Kaitlyn Johnson Date: Tue, 28 Jan 2025 11:05:04 +0000 Subject: [PATCH 14/18] move bib --- vignettes/{chunks => }/library.bib | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename vignettes/{chunks => }/library.bib (100%) diff --git a/vignettes/chunks/library.bib b/vignettes/library.bib similarity index 100% rename from vignettes/chunks/library.bib rename to vignettes/library.bib From 3d0705dfc86c7b510b6b5b4fa5eba3c2d254de93 Mon Sep 17 00:00:00 2001 From: Kaitlyn Johnson Date: Tue, 28 Jan 2025 11:09:39 +0000 Subject: [PATCH 15/18] fix docs --- DESCRIPTION | 3 +-- man/autoescape_brackets.Rd | 18 ++++++++++++++++++ man/dot-extract_function_name.Rd | 24 ------------------------ 3 files changed, 19 insertions(+), 26 deletions(-) create mode 100644 man/autoescape_brackets.Rd delete mode 100644 man/dot-extract_function_name.Rd diff --git a/DESCRIPTION b/DESCRIPTION index f18143c..0f305d7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -14,6 +14,7 @@ Authors@R: comment = c(ORCID = "0000-0001-8057-8037")), person(given = "Johannes", family = "Bracher", + role = c("aut"), email = "johannes.bracher@kit.edu", comment = c(ORCID = "0000-0002-3777-1410")), person(given = "Sebastian", @@ -29,8 +30,6 @@ URL: https://github.com/epinowcast/baselinenowcast/ BugReports: https://github.com/epinowcast/baselinenowcast/issues Depends: R (>= 4.0.0) -Imports: - spelling (>= 2.3.0) Suggests: dplyr, bookdown, diff --git a/man/autoescape_brackets.Rd b/man/autoescape_brackets.Rd new file mode 100644 index 0000000..a949169 --- /dev/null +++ b/man/autoescape_brackets.Rd @@ -0,0 +1,18 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/utils.R +\name{autoescape_brackets} +\alias{autoescape_brackets} +\title{Escape brackets returned in a string for passing to glue} +\usage{ +autoescape_brackets(string) +} +\arguments{ +\item{string}{A string vector containing \code{{}}} +} +\value{ +A string vector where all single brackets are replaced with double +brackets +} +\description{ +Escape brackets returned in a string for passing to glue +} diff --git a/man/dot-extract_function_name.Rd b/man/dot-extract_function_name.Rd deleted file mode 100644 index 39a5a6f..0000000 --- a/man/dot-extract_function_name.Rd +++ /dev/null @@ -1,24 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/utils.R -\name{.extract_function_name} -\alias{.extract_function_name} -\title{Extract Base Function Name -Adopted from https://github.com/epinowcast/primarycensored/blob/04f3ff2e5c8741c1f6e003566c68bbaf491cb073/R/utils.R#L11 #nolint -This helper function extracts the base name of a function, removing an -namespace prefixes.} -\usage{ -.extract_function_name(func) -} -\arguments{ -\item{func}{The output of \code{substitute} on a function.} -} -\value{ -A character string representing the base name of the function. -} -\description{ -Extract Base Function Name -Adopted from https://github.com/epinowcast/primarycensored/blob/04f3ff2e5c8741c1f6e003566c68bbaf491cb073/R/utils.R#L11 #nolint -This helper function extracts the base name of a function, removing an -namespace prefixes. -} -\keyword{internal} From bcb18ff6fe674a3a97d927439d8ddbff23a40e4a Mon Sep 17 00:00:00 2001 From: Kaitlyn Johnson Date: Tue, 28 Jan 2025 16:40:37 +0000 Subject: [PATCH 16/18] tweaks to skeleton --- .github/workflows/R-CMD-as-cran-check.yaml | 47 ---------------------- .github/workflows/test-coverage.yaml | 6 --- .github/workflows/update-citation-cff.yaml | 1 - NEWS.md | 2 +- README.Rmd | 4 +- 5 files changed, 3 insertions(+), 57 deletions(-) delete mode 100644 .github/workflows/R-CMD-as-cran-check.yaml diff --git a/.github/workflows/R-CMD-as-cran-check.yaml b/.github/workflows/R-CMD-as-cran-check.yaml deleted file mode 100644 index b80d584..0000000 --- a/.github/workflows/R-CMD-as-cran-check.yaml +++ /dev/null @@ -1,47 +0,0 @@ -# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag. -# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions -on: - push: - branches: - - main - schedule: - - cron: '5 4 * * 1' - pull_request: - branches: - - main - merge_group: - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref }} - cancel-in-progress: true - -name: R-CMD-as-cran-check - -jobs: - R-CMD-as-cran-check: - if: "! contains(github.event.head_commit.message, '[ci skip]')" - runs-on: ubuntu-latest - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - NOT_CRAN: false - - steps: - - uses: actions/checkout@v4 - - - uses: r-lib/actions/setup-pandoc@v2 - - - uses: r-lib/actions/setup-r@v2 - with: - dependencies: '"hard"' - use-public-rspm: true - extra-repositories: 'https://stan-dev.r-universe.dev' - - - uses: r-lib/actions/setup-r-dependencies@v2 - with: - extra-packages: any::rcmdcheck - needs: check - - - uses: r-lib/actions/check-r-package@v2 - with: - upload-snapshots: true diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 55ed604..c681b81 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -35,12 +35,6 @@ jobs: extra-packages: any::covr needs: coverage - - name: Install cmdstan - uses: epinowcast/actions/install-cmdstan@v1 - with: - cmdstan-version: 'latest' - num-cores: 2 - - name: Test coverage run: covr::codecov(quiet = FALSE, token = "${{ secrets.CODECOV_TOKEN }}") shell: Rscript {0} diff --git a/.github/workflows/update-citation-cff.yaml b/.github/workflows/update-citation-cff.yaml index 5a682eb..905a99e 100644 --- a/.github/workflows/update-citation-cff.yaml +++ b/.github/workflows/update-citation-cff.yaml @@ -30,7 +30,6 @@ jobs: - uses: r-lib/actions/setup-r@v2 with: use-public-rspm: true - extra-repositories: 'https://stan-dev.r-universe.dev' - uses: r-lib/actions/setup-r-dependencies@v2 with: extra-packages: | diff --git a/NEWS.md b/NEWS.md index ff5cad9..7b180ec 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,3 @@ -# baselinenowcast 0.0.0.100 +# baselinenowcast 0.0.0.1000 - Added package skeleton. diff --git a/README.Rmd b/README.Rmd index a49e9d6..2ac0dc2 100644 --- a/README.Rmd +++ b/README.Rmd @@ -17,9 +17,9 @@ knitr::opts_chunk$set( [![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable) -[![R-CMD-check](https://github.com/epinowcast/primarycensored/workflows/R-CMD-check/badge.svg)](https://github.com/epinowcast/baselinenowcast/actions/workflows/R-CMD-check.yaml) [![Codecov test coverage](https://codecov.io/gh/epinowcast/baselinenowcast/branch/main/graph/badge.svg)](https://app.codecov.io/gh/epinowcast/baselinenowcast) +[![R-CMD-check](https://github.com/epinowcast/baselinenowcast/workflows/R-CMD-check/badge.svg)](https://github.com/epinowcast/baselinenowcast/actions/workflows/R-CMD-check.yaml) [![Codecov test coverage](https://codecov.io/gh/epinowcast/baselinenowcast/branch/main/graph/badge.svg)](https://app.codecov.io/gh/epinowcast/baselinenowcast) -[![Universe](https://epinowcast.r-universe.dev/badges/primarycensored)](https://epinowcast.r-universe.dev/baselinenowcast) +[![Universe](https://epinowcast.r-universe.dev/badges/baselinenowcast)](https://epinowcast.r-universe.dev/baselinenowcast) [![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/epinowcast/baselinenowcast/blob/master/LICENSE.md/) [![GitHub contributors](https://img.shields.io/github/contributors/epinowcast/baselinenowcast)](https://github.com/epinowcast/baselinenowcast/graphs/contributors) From 90da76f77fcbbca4353ee6ea37b6e74b25ef8e5f Mon Sep 17 00:00:00 2001 From: Kaitlyn Johnson Date: Tue, 28 Jan 2025 16:44:23 +0000 Subject: [PATCH 17/18] remove a bunch of instances of extra repository stan universe" --- .github/workflows/codemeta.yaml | 1 - .github/workflows/lint-changed-files.yaml | 1 - .github/workflows/pkgdown.yaml | 1 - .github/workflows/pr-commands.yaml | 1 - .github/workflows/render-readme.yaml | 1 - .github/workflows/test-coverage.yaml | 1 - 6 files changed, 6 deletions(-) diff --git a/.github/workflows/codemeta.yaml b/.github/workflows/codemeta.yaml index 0c41148..b7e17da 100644 --- a/.github/workflows/codemeta.yaml +++ b/.github/workflows/codemeta.yaml @@ -19,7 +19,6 @@ jobs: - uses: r-lib/actions/setup-r@v2 with: use-public-rspm: true - extra-repositories: 'https://stan-dev.r-universe.dev' - uses: r-lib/actions/setup-r-dependencies@v2 with: diff --git a/.github/workflows/lint-changed-files.yaml b/.github/workflows/lint-changed-files.yaml index 36c6e2e..61d45bd 100644 --- a/.github/workflows/lint-changed-files.yaml +++ b/.github/workflows/lint-changed-files.yaml @@ -20,7 +20,6 @@ jobs: - uses: r-lib/actions/setup-r@v2 with: use-public-rspm: true - extra-repositories: 'https://stan-dev.r-universe.dev' - uses: r-lib/actions/setup-r-dependencies@v2 with: diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 5ca6088..b081cd8 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -27,7 +27,6 @@ jobs: - uses: r-lib/actions/setup-r@v2 with: use-public-rspm: true - extra-repositories: 'https://stan-dev.r-universe.dev' - uses: r-lib/actions/setup-r-dependencies@v2 with: diff --git a/.github/workflows/pr-commands.yaml b/.github/workflows/pr-commands.yaml index fd5ccd8..f49b721 100644 --- a/.github/workflows/pr-commands.yaml +++ b/.github/workflows/pr-commands.yaml @@ -23,7 +23,6 @@ jobs: - uses: r-lib/actions/setup-r@v2 with: use-public-rspm: true - extra-repositories: 'https://stan-dev.r-universe.dev' - uses: r-lib/actions/setup-r-dependencies@v2 with: diff --git a/.github/workflows/render-readme.yaml b/.github/workflows/render-readme.yaml index 7123046..d5b2d22 100644 --- a/.github/workflows/render-readme.yaml +++ b/.github/workflows/render-readme.yaml @@ -22,7 +22,6 @@ jobs: - uses: r-lib/actions/setup-r@v2 with: use-public-rspm: true - extra-repositories: 'https://stan-dev.r-universe.dev' - name: Setup pandoc uses: r-lib/actions/setup-pandoc@v2 diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index c681b81..39617d8 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -28,7 +28,6 @@ jobs: - uses: r-lib/actions/setup-r@v2 with: use-public-rspm: true - extra-repositories: 'https://stan-dev.r-universe.dev' - uses: r-lib/actions/setup-r-dependencies@v2 with: From 7d873d7265e419969c69f6e8ee135ea7f993dca7 Mon Sep 17 00:00:00 2001 From: Kaitlyn Johnson Date: Wed, 29 Jan 2025 09:03:26 +0000 Subject: [PATCH 18/18] add back in enwtheme --- DESCRIPTION | 2 ++ _pkgdown.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/DESCRIPTION b/DESCRIPTION index 0f305d7..ec8bd93 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -44,3 +44,5 @@ Encoding: UTF-8 Roxygen: list(markdown = TRUE) RoxygenNote: 7.3.2 VignetteBuilder: knitr +Config/Needs/hexsticker: hexSticker, sysfonts, ggplot2 +Config/Needs/website: r-lib/pkgdown, epinowcast/enwtheme diff --git a/_pkgdown.yml b/_pkgdown.yml index d983d4a..8fa613e 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -1,7 +1,9 @@ url: https://baselinenowcast.epinowcast.org/ template: + pacakge: enwtheme math-rendering: mathjax + development: mode: auto