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/.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..991bda2
--- /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/codemeta.yaml b/.github/workflows/codemeta.yaml
new file mode 100644
index 0000000..b7e17da
--- /dev/null
+++ b/.github/workflows/codemeta.yaml
@@ -0,0 +1,44 @@
+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
+
+ - 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..61d45bd
--- /dev/null
+++ b/.github/workflows/lint-changed-files.yaml
@@ -0,0 +1,49 @@
+# 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
+
+ - 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
new file mode 100644
index 0000000..b081cd8
--- /dev/null
+++ b/.github/workflows/pkgdown.yaml
@@ -0,0 +1,53 @@
+# 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
+
+ - 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/pr-commands.yaml b/.github/workflows/pr-commands.yaml
new file mode 100644
index 0000000..f49b721
--- /dev/null
+++ b/.github/workflows/pr-commands.yaml
@@ -0,0 +1,109 @@
+# 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
+
+ - 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
new file mode 100644
index 0000000..d5b2d22
--- /dev/null
+++ b/.github/workflows/render-readme.yaml
@@ -0,0 +1,64 @@
+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
+
+ - 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: 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: 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: kaitejohnson
+ 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..39617d8
--- /dev/null
+++ b/.github/workflows/test-coverage.yaml
@@ -0,0 +1,39 @@
+# 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
+
+ - uses: r-lib/actions/setup-r-dependencies@v2
+ with:
+ extra-packages: any::covr
+ needs: coverage
+
+ - 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
new file mode 100644
index 0000000..905a99e
--- /dev/null
+++ b/.github/workflows/update-citation-cff.yaml
@@ -0,0 +1,61 @@
+# 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
+ - 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/.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..5d12fd7
--- /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
new file mode 100644
index 0000000..ec8bd93
--- /dev/null
+++ b/DESCRIPTION
@@ -0,0 +1,48 @@
+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",
+ role = c("aut"),
+ 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 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)
+Suggests:
+ dplyr,
+ bookdown,
+ ggplot2,
+ spelling,
+ rmarkdown,
+ testthat (>= 3.1.9),
+ usethis,
+ withr,
+ knitr
+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/LICENSE b/LICENSE
index 52ae40b..b81dba3 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
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..e651b94
--- /dev/null
+++ b/NAMESPACE
@@ -0,0 +1 @@
+# Generated by roxygen2: do not edit by hand
diff --git a/NEWS.md b/NEWS.md
new file mode 100644
index 0000000..7b180ec
--- /dev/null
+++ b/NEWS.md
@@ -0,0 +1,3 @@
+# baselinenowcast 0.0.0.1000
+
+- Added package skeleton.
diff --git a/R/utils.R b/R/utils.R
new file mode 100644
index 0000000..93acb93
--- /dev/null
+++ b/R/utils.R
@@ -0,0 +1,9 @@
+#' Escape brackets returned in a string for passing to glue
+#'
+#' @param string A string vector containing `{}`
+#'
+#' @return A string vector where all single brackets are replaced with double
+#' brackets
+autoescape_brackets <- function(string) {
+ return(gsub("\\{|\\}", "", string))
+}
diff --git a/README.Rmd b/README.Rmd
new file mode 100644
index 0000000..2ac0dc2
--- /dev/null
+++ b/README.Rmd
@@ -0,0 +1,78 @@
+---
+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
+)
+```
+# Baseline nowcast
+
+
+[](https://lifecycle.r-lib.org/articles/stages.html#stable)
+[](https://github.com/epinowcast/baselinenowcast/actions/workflows/R-CMD-check.yaml) [](https://app.codecov.io/gh/epinowcast/baselinenowcast)
+
+[](https://epinowcast.r-universe.dev/baselinenowcast)
+[](https://github.com/epinowcast/baselinenowcast/blob/master/LICENSE.md/)
+[](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:
+
+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
+
+
diff --git a/_pkgdown.yml b/_pkgdown.yml
new file mode 100644
index 0000000..8fa613e
--- /dev/null
+++ b/_pkgdown.yml
@@ -0,0 +1,16 @@
+url: https://baselinenowcast.epinowcast.org/
+template:
+ pacakge: 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/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/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/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
new file mode 100644
index 0000000..484df2d
--- /dev/null
+++ b/tests/testthat.R
@@ -0,0 +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")
+}
diff --git a/tests/testthat/test-utils.R b/tests/testthat/test-utils.R
new file mode 100644
index 0000000..441f328
--- /dev/null
+++ b/tests/testthat/test-utils.R
@@ -0,0 +1,4 @@
+test_that("string is returned without brackets", {
+ new_string <- autoescape_brackets("This string has {brackets}")
+ expect_identical(new_string, "This string has brackets")
+})
diff --git a/vignettes/baselinenowcast.Rmd b/vignettes/baselinenowcast.Rmd
new file mode 100644
index 0000000..8bb2a5f
--- /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) # 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
new file mode 100644
index 0000000..ec3a4bc
--- /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(file.path("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.*
diff --git a/vignettes/library.bib b/vignettes/library.bib
new file mode 100644
index 0000000..3939d3e
--- /dev/null
+++ b/vignettes/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},
+
+}