Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@
^docs$
^pkgdown$
^\.github$

# Tech stack
^\.devcontainer$
^\.vscode$
^\.github$
4 changes: 4 additions & 0 deletions .devcontainer/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"r.plot.useHttpgd": true,
"r.alwaysUseActiveTerminal": true
}
43 changes: 43 additions & 0 deletions .devcontainer/Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
FROM ghcr.io/rocker-org/devcontainer/r-ver:4.5

# Architecture-specific variable (built in Docker BuildKit)
ARG TARGETARCH

# Runtime dependency for R package 'fs' (provides libuv.so.1)
RUN apt-get update && \
apt-get install -y --no-install-recommends libuv1t64 && \
rm -rf /var/lib/apt/lists/*

# Install quarto-cli and the orange-book extension
RUN wget https://github.com/quarto-dev/quarto-cli/releases/download/v1.9.35/quarto-1.9.35-linux-${TARGETARCH}.deb && \
dpkg -i quarto-1.9.35-linux-${TARGETARCH}.deb && \
rm quarto-1.9.35-linux-${TARGETARCH}.deb

# Adding R packages
RUN install2.r --error fable \
fabletools \
progressr \
feasts \
tsibble \
dplyr \
tidyr \
ggplot2 \
distributional \
epidatr \
rlang \
EpiEstim \
projections \
incidence \
jsonlite \
baselinenowcast \
DiagrammeR \
knitr \
rmarkdown \
devtools \
pipetime \
fable.prophet \
testthat

RUN installGithub.r hubverse-org/hubEvals

CMD ["bash"]
42 changes: 42 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/cpp
{
"name": "ACCIDDA - acciddasuite",
"build": {
"dockerfile": "Containerfile"
},
"customizations": {
"vscode": {
"extensions": [
"reditorsupport.r",
"rdebugger.r-debugger",
"quarto.quarto",
"tianyishi.rmarkdown",
"github.vscode-github-actions",
"ms-vscode.live-server"
]
}
},
"mounts": [
// Mount the .vscode configuration into the container
"source=${localWorkspaceFolder}/.devcontainer/.vscode,target=/workspaces/${localWorkspaceFolderBasename}/.vscode,type=bind,consistency=cached"
],
// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers/features/github-cli:1": {
"version": "2.68.1"
}
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "gcc -v",

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
"remoteUser": "root"
}
42 changes: 42 additions & 0 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: "Copilot Setup Steps"

# Automatically run the setup steps when they are changed to allow for easy validation, and
# allow manual testing through the repository's "Actions" tab
on:
workflow_dispatch:
push:
paths:
- .github/workflows/copilot-setup-steps.yml
pull_request:
paths:
- .github/workflows/copilot-setup-steps.yml

jobs:
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
copilot-setup-steps:
runs-on: ubuntu-latest

# Set the permissions to the lowest permissions possible needed for your steps.
# Copilot will be given its own token for its operations.
permissions:
# If you want to clone the repository as part of your setup steps, for example to install dependencies, you'll need the `contents: read` permission. If you don't clone the repository in your setup steps, Copilot will do this for you automatically after the steps complete.
contents: read

# You can define any steps you want, and they will run before the agent starts.
# If you do not check out your code, Copilot will do this for you.
steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Set up R
uses: r-lib/actions/setup-r@v2
with:
r-version: 'release'

- name: Install dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: |
any::rcmdcheck
any::testthat
needs: check
39 changes: 39 additions & 0 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: Coverage

jobs:
coverage:
runs-on: ubuntu-latest
name: Coverage

steps:
- uses: actions/checkout@v4

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

- uses: r-lib/actions/setup-r@v2.9.0

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: |
any::covr
needs: check

- name: Running coverage
run: |
# Files to exclude
files <- list.files("inst/", full.names = TRUE, recursive = TRUE)

# Run coverage
covr::codecov(
line_exclusions = as.list(files),
token = Sys.getenv("CODECOV_TOKEN")
)
shell: Rscript {0}
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
21 changes: 20 additions & 1 deletion .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ on:

name: pkgdown.yaml

permissions: read-all
permissions:
read-all:
pull-requests: write

jobs:
pkgdown:
Expand Down Expand Up @@ -40,6 +42,23 @@ jobs:
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

# Upload artifact for PR preview (only for pull requests)
- name: Upload PR artifact
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
with:
name: pkgdown-site
path: docs

# Post comment with link to artifact on PRs
- name: Post artifact link to PR
if: github.event_name == 'pull_request'
uses: CDCgov/cfa-actions/post-artifact@v1.2.0
with:
artifact-name: pkgdown-site
gh-token: ${{ secrets.GITHUB_TOKEN }}
message: 'Thank you for your contribution @${{ github.actor }} :rocket:! The pkgdown site preview is ready for review :point_right: [Download here]({ artifact-url }) :point_left:!'

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4.5.0
Expand Down
99 changes: 99 additions & 0 deletions .github/workflows/r.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# 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
#
# NOTE: This workflow is overkill for most R packages and
# check-standard.yaml is likely a better choice.
# usethis::use_github_action("check-standard") will install it.
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: R-CMD-check-final

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

jobs:

R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
# - {os: macOS-latest, r: 'devel', http-user-agent: 'release'}
- {os: windows-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v6

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: quarto-dev/quarto-actions/setup@v2.2.0
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tinytex: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
install-quarto: false
install-pandoc: false
extra-packages:
any::rcmdcheck
any::testthat
needs: check

- uses: r-lib/actions/check-r-package@v2
if: ${{ matrix.config.os == 'ubuntu-latest' && matrix.config.r == 'release' }}
with:
args: 'c("--as-cran", "--no-manual")'
upload-snapshots: false
upload-results: false
check-dir: '"check"'
error-on: '"warning"'

- uses: r-lib/actions/check-r-package@v2
if: ${{ matrix.config.os != 'windows-latest' && (matrix.config.os != 'ubuntu-latest' || matrix.config.r != 'release') }}
with:
upload-snapshots: false
upload-results: false
check-dir: '"check"'
error-on: '"warning"'

- name: Check package (Windows)
if: ${{ matrix.config.os == 'windows-latest' }}
run: |
R.exe CMD build .
R.exe CMD check --no-manual (Get-Item acciddasuite_*.tar.gz).Name
shell: pwsh

- name: Build the package
if: ${{ matrix.config.os == 'ubuntu-latest' && (matrix.config.r == 'release' || matrix.config.r == 'devel') }}
run: R CMD build .

- uses: actions/upload-artifact@v4
if: ${{ matrix.config.os == 'ubuntu-latest' && (matrix.config.r == 'release' || matrix.config.r == 'devel') }}
with:
name: acciddasuite-built-package-${{ matrix.config.os }}-${{ matrix.config.r }}
path: acciddasuite_*.tar.gz
retention-days: 7

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ docs
.Ruserdata

**/*.quarto_ipynb
.vscode/
*.html
7 changes: 7 additions & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ output: github_document

<!-- README.md is generated from README.Rmd. Please edit that file -->

```{=markdown}
[![R-CMD-check](https://github.com/ACCIDDA/acciddasuite/actions/workflows/r.yml/badge.svg)](https://github.com/ACCIDDA/acciddasuite/actions/workflows/r.yml)
[![codecov](https://codecov.io/gh/ACCIDDA/acciddasuite/graph/badge.svg?token=ZB8FVLI7GN)](https://app.codecov.io/gh/ACCIDDA/acciddasuite)
[![status](https://tinyverse.netlify.app/badge/acciddasuite)](https://CRAN.R-project.org/package=acciddasuite)
```
<!-- badges: end -->

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
Expand Down
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@

<!-- README.md is generated from README.Rmd. Please edit that file -->

[![R-CMD-check](https://github.com/ACCIDDA/acciddasuite/actions/workflows/r.yml/badge.svg)](https://github.com/ACCIDDA/acciddasuite/actions/workflows/r.yml)
[![codecov](https://codecov.io/gh/ACCIDDA/acciddasuite/graph/badge.svg?token=ZB8FVLI7GN)](https://app.codecov.io/gh/ACCIDDA/acciddasuite)
[![status](https://tinyverse.netlify.app/badge/acciddasuite)](https://CRAN.R-project.org/package=acciddasuite)

<!-- badges: end -->

# acciddasuite <a href="https://accidda.github.io/acciddasuite/"><img src="man/figures/logo.png" align="right" height="139" alt="acciddasuite website" /></a>

<!-- badges: start -->
Expand Down Expand Up @@ -48,6 +54,20 @@ fcast <- example_data |>
)
#> ℹ Using max_delay = 12 from data
#> ℹ Truncating from max_delay = 12 to 4.
#> Warning: 1 error encountered for ARIMA
#> [1]
#> ℹ Some rows containing NA values may be removed. This is fine if not
#> unexpected.
#> ℹ Some rows containing NA values may be removed. This is fine if not
#> unexpected.
#> Warning: 1 error encountered for ARIMA
#> [1]
#>
#> 1 error encountered for ARIMA
#> [1]
#>
#> 1 error encountered for ARIMA
#> [1]
```

``` r
Expand Down
Binary file modified man/figures/README-unnamed-chunk-5-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.