Skip to content

Commit

Permalink
Merge pull request #64 from Lifebrain/doctype
Browse files Browse the repository at this point in the history
Doctype
  • Loading branch information
osorensen authored Jul 3, 2024
2 parents 06d0ba6 + 8cb9529 commit 60f4f98
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 28 deletions.
26 changes: 16 additions & 10 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# 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:
push:
branches: [main, master, develop]
branches: [main, master]
pull_request:
branches: [main, master, develop]
branches: [main, master]

name: R-CMD-check

permissions: read-all

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}
Expand All @@ -18,7 +20,7 @@ jobs:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
Expand All @@ -29,18 +31,22 @@ jobs:
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

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

- uses: r-lib/actions/setup-r@v1
- 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: r-lib/actions/setup-r-dependencies@v1
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: rcmdcheck
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v1
- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
47 changes: 39 additions & 8 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -1,30 +1,61 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# 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:
push:
branches: [main, master, develop]
branches: [main, master]
pull_request:
branches: [main, master, develop]
branches: [main, master]

name: test-coverage

permissions: read-all

jobs:
test-coverage:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v1
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: covr
extra-packages: any::covr, any::xml2
needs: coverage

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

- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }}
file: ./cobertura.xml
plugin: noop
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}

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

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Imports:
ggplot2,
metafor,
rlang
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
Suggests:
roxygen2,
knitr,
Expand Down
3 changes: 1 addition & 2 deletions R/metagam_package.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
#' \code{\link{plot_heterogeneity}} can be used to study the meta-analytic fit
#' computed by \code{\link{strip_rawdata}}.
#'
#' @docType package
#' @name metagam-package
#'
#' @importFrom rlang .data
NULL
"_PACKAGE"
1 change: 1 addition & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ devtools::load_all(".")
[![R-CMD-check](https://github.com/Lifebrain/metagam/workflows/R-CMD-check/badge.svg)](https://github.com/Lifebrain/metagam/actions)
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[![Codecov test coverage](https://codecov.io/gh/Lifebrain/metagam/branch/master/graph/badge.svg)](https://app.codecov.io/gh/Lifebrain/metagam?branch=master)
[![R-CMD-check](https://github.com/Lifebrain/metagam/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/Lifebrain/metagam/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->


Expand Down
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ status](https://www.r-pkg.org/badges/version/metagam)](https://CRAN.R-project.or
experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[![Codecov test
coverage](https://codecov.io/gh/Lifebrain/metagam/branch/master/graph/badge.svg)](https://app.codecov.io/gh/Lifebrain/metagam?branch=master)
[![R-CMD-check](https://github.com/Lifebrain/metagam/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/Lifebrain/metagam/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

## Overview
Expand All @@ -31,10 +32,10 @@ Zanobetti (2000) and Crippa, Thomas, and Orsini (2018).
Currently, GAMs objects created with the following functions are
supported:

- From package [mgcv](https://cran.r-project.org/package=mgcv):
`bam()`, `gam()` and `gamm()`.
- From package [gamm4](https://cran.r-project.org/package=gamm4):
`gamm4()`.
- From package [mgcv](https://cran.r-project.org/package=mgcv): `bam()`,
`gam()` and `gamm()`.
- From package [gamm4](https://cran.r-project.org/package=gamm4):
`gamm4()`.

This package is under development, so changes to the interface can be
expected. Suggestions for improvements and bug reports are warmly
Expand Down Expand Up @@ -65,7 +66,7 @@ remotes::install_github("lifebrain/metagam")
library("metagam")
library("mgcv")
#> Loading required package: nlme
#> This is mgcv 1.8-38. For overview type 'help("mgcv-package")'.
#> This is mgcv 1.9-1. For overview type 'help("mgcv-package")'.
```

Simulate three datasets and fit a GAM to each of them. Then use
Expand All @@ -91,7 +92,7 @@ participant data. We can then meta-analyze them using `metagam()`.
``` r
meta_analysis <- metagam(models)
summary(meta_analysis)
#> Meta-analysis of GAMs from 3 cohorts, using method FE.
#> Meta-analysis of GAMs from cohorts, using method FE.
#>
#> Smooth terms analyzed: s(x2).
```
Expand All @@ -108,7 +109,8 @@ By contributing to this project, you agree to abide by its terms.

## References

<div id="refs" class="references csl-bib-body hanging-indent">
<div id="refs" class="references csl-bib-body hanging-indent"
entry-spacing="0">

<div id="ref-Crippa2018" class="csl-entry">

Expand Down

0 comments on commit 60f4f98

Please sign in to comment.