Skip to content

Commit

Permalink
fix github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
lbau7 committed Sep 29, 2023
1 parent b19cc5e commit 22eba77
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 168 deletions.
46 changes: 0 additions & 46 deletions .github/workflows/R-CMD-check-HTML5.yaml

This file was deleted.

49 changes: 49 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -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:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: R-CMD-check

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: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

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

steps:
- uses: actions/checkout@v3

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

- 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@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
85 changes: 0 additions & 85 deletions .github/workflows/check-standard.yaml

This file was deleted.

60 changes: 31 additions & 29 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -1,48 +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:
push:
branches:
- main
- master
branches: [main, master]
pull_request:
branches:
- main
- master
branches: [main, master]

name: test-coverage

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

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

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

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

- name: Query dependencies
- name: Test coverage
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
covr::codecov(
quiet = FALSE,
clean = FALSE,
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
)
shell: Rscript {0}

- name: Restore R package cache
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install dependencies
- name: Show testthat output
if: always()
run: |
install.packages(c("remotes"))
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("covr")
shell: Rscript {0}
## --------------------------------------------------------------------
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Test coverage
run: covr::codecov()
shell: Rscript {0}
- name: Upload test results
if: failure()
uses: actions/upload-artifact@v3
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
1 change: 1 addition & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ knitr::opts_chunk$set(
[![R-CMD-check](https://github.com/imbi-heidelberg/blindrecalc/workflows/R-CMD-check/badge.svg)](https://github.com/imbi-heidelberg/blindrecalc/actions)
[![Codecov test coverage](https://codecov.io/gh/imbi-heidelberg/blindrecalc/branch/master/graph/badge.svg)](https://app.codecov.io/gh/imbi-heidelberg/blindrecalc?branch=master)
[![CRAN status](https://www.r-pkg.org/badges/version/blindrecalc)](https://cran.r-project.org/package=blindrecalc)
[![R-CMD-check](https://github.com/imbi-heidelberg/blindrecalc/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/imbi-heidelberg/blindrecalc/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

# blindrecalc
Expand Down
22 changes: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
coverage](https://codecov.io/gh/imbi-heidelberg/blindrecalc/branch/master/graph/badge.svg)](https://app.codecov.io/gh/imbi-heidelberg/blindrecalc?branch=master)
[![CRAN
status](https://www.r-pkg.org/badges/version/blindrecalc)](https://cran.r-project.org/package=blindrecalc)
[![R-CMD-check](https://github.com/imbi-heidelberg/blindrecalc/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/imbi-heidelberg/blindrecalc/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

# blindrecalc
Expand Down Expand Up @@ -65,7 +66,7 @@ size recalculation, use `toer`:

``` r
toer(design, n1 = c(30, 60, 90), nuisance = 10, recalculation = TRUE)
#> [1] 0.0263 0.0271 0.0242
#> [1] 0.0270 0.0249 0.0230
```

`n1` refers to the sample size of the internal pilot study
Expand All @@ -76,18 +77,23 @@ To compute the power of the design, use `pow`:

``` r
pow(design, n1 = c(30, 60, 90), nuisance = 10, recalculation = TRUE)
#> [1] 0.7979 0.7938 0.8067
#> [1] 0.7869 0.7975 0.7999
```

To calculate the distribution of the total sample sizes use `n_dist`:

``` r
n_dist(design, n1 = c(30, 60, 90), nuisance = 10)
#> n_1 = 30 n_1 = 60 n_1 = 90
#> Min. : 40.0 Min. : 64.0 Min. : 90.0
#> 1st Qu.:109.0 1st Qu.:117.0 1st Qu.:120.0
#> Median :131.0 Median :133.0 Median :133.0
#> Mean :134.2 Mean :133.9 Mean :134.1
#> 3rd Qu.:156.0 3rd Qu.:149.0 3rd Qu.:147.0
#> Max. :305.0 Max. :251.0 Max. :219.0
#> Min. : 30.0 Min. : 62.0 Min. : 90.0
#> 1st Qu.:110.0 1st Qu.:117.0 1st Qu.:120.0
#> Median :132.0 Median :132.0 Median :133.0
#> Mean :134.8 Mean :134.2 Mean :133.8
#> 3rd Qu.:157.0 3rd Qu.:150.0 3rd Qu.:147.0
#> Max. :297.0 Max. :242.0 Max. :219.0
```

## Reference

A paper describing blindrecalc can be found
[here](https://journal.r-project.org/articles/RJ-2022-001/).

0 comments on commit 22eba77

Please sign in to comment.