diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml new file mode 100644 index 000000000..9f9b10800 --- /dev/null +++ b/.github/workflows/R-CMD-check.yaml @@ -0,0 +1,60 @@ +# 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 + +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'} + # use 4.1 to check with rtools40's older compiler + # - {os: windows-latest, r: '4.1'} + + - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} + - {os: ubuntu-latest, r: 'release'} + - {os: ubuntu-latest, r: 'oldrel-1'} + # - {os: ubuntu-latest, r: 'oldrel-2'} + # - {os: ubuntu-latest, r: 'oldrel-3'} + # - {os: ubuntu-latest, r: 'oldrel-4'} + + 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 diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml new file mode 100644 index 000000000..2c5bb5029 --- /dev/null +++ b/.github/workflows/test-coverage.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: + push: + branches: [main, master] + pull_request: + branches: [main, master] + +name: test-coverage + +jobs: + test-coverage: + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + + steps: + - uses: actions/checkout@v3 + + - 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, + clean = FALSE, + install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package") + ) + shell: Rscript {0} + + - 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@v3 + with: + name: coverage-test-failures + path: ${{ runner.temp }}/package diff --git a/DESCRIPTION b/DESCRIPTION index 765b97d3b..ea390d3a5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -5,14 +5,16 @@ Authors@R: c( person("Daniel", "Sjoberg", , "sjobergd@gene.com", role = c("aut", "cre")), person("F. Hoffmann-La Roche AG", role = c("cph", "fnd")) ) -Description: R Package to Supplement ARD Functions Found in {cards}. +Description: Extra Analysis Results Data (ARD) functions. The package + supplements the ARD functions from the 'cards' package, exporting + functions to put statistical results in the ARD format. License: Apache License 2.0 URL: https://github.com/insightsengineering/cardx BugReports: https://github.com/insightsengineering/cardx/issues Depends: R (>= 4.1) Imports: - cards (>= 0.0.0.9039), + cards (>= 0.0.0.9044), cli (>= 3.6.1), dplyr (>= 1.1.2), glue (>= 1.6.2), diff --git a/R/ard_ttest.R b/R/ard_ttest.R index d739eeb56..f3e889b64 100644 --- a/R/ard_ttest.R +++ b/R/ard_ttest.R @@ -62,7 +62,7 @@ ard_ttest <- function(data, by, variable, ...) { variable = variable, lst_tidy = cards::eval_capture_conditions( - stats::t.test(data[[variable]] ~ data[[by]], paired = FALSE, ...) |> + stats::t.test(data[[variable]] ~ data[[by]], ...) |> broom::tidy() ), paired = FALSE, diff --git a/R/ard_wilcoxtest.R b/R/ard_wilcoxtest.R index f440f57c8..3ed5a1e4a 100644 --- a/R/ard_wilcoxtest.R +++ b/R/ard_wilcoxtest.R @@ -62,7 +62,7 @@ ard_wilcoxtest <- function(data, by, variable, ...) { variable = variable, lst_tidy = cards::eval_capture_conditions( - stats::wilcox.test(data[[variable]] ~ data[[by]], paired = FALSE, ...) |> + stats::wilcox.test(data[[variable]] ~ data[[by]], ...) |> broom::tidy() ), paired = FALSE, diff --git a/man/cardx-package.Rd b/man/cardx-package.Rd index fb3886d59..896af5fb9 100644 --- a/man/cardx-package.Rd +++ b/man/cardx-package.Rd @@ -8,7 +8,7 @@ \description{ \if{html}{\figure{logo.png}{options: style='float: right' alt='logo' width='120'}} -R Package to Supplement ARD Functions Found in {cards}. +Extra Analysis Results Data (ARD) functions. The package supplements the ARD functions from the 'cards' package, exporting functions to put statistical results in the ARD format. } \seealso{ Useful links: