diff --git a/.Rbuildignore b/.Rbuildignore index aa82f81..16fded3 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -12,3 +12,4 @@ ^README\.Rmd$ ^residuals.Rmd$ ^tests.R$ +^\.github$ 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..562fe0f --- /dev/null +++ b/.github/workflows/R-CMD-check.yaml @@ -0,0 +1,51 @@ +# 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: + +name: R-CMD-check.yaml + +permissions: read-all + +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@v4 + + - 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 + build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml new file mode 100644 index 0000000..e050312 --- /dev/null +++ b/.github/workflows/test-coverage.yaml @@ -0,0 +1,61 @@ +# 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: + +name: test-coverage.yaml + +permissions: read-all + +jobs: + test-coverage: + runs-on: ubuntu-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::covr, any::xml2 + needs: coverage + + - name: Test coverage + 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 if error if not on PR, or if on PR and token is given + fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }} + 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 diff --git a/README.Rmd b/README.Rmd index 40028a6..4dcc814 100644 --- a/README.Rmd +++ b/README.Rmd @@ -14,6 +14,12 @@ knitr::opts_chunk$set( # ggResidpanel + +[![CRAN status](https://www.r-pkg.org/badges/version/ggResidpanel)](https://CRAN.R-project.org/package=ggResidpanel) +[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable) +[![R-CMD-check](https://github.com/goodekat/ggResidpanel/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/goodekat/ggResidpanel/actions/workflows/R-CMD-check.yaml) + + ggResidpanel is an R package for creating panels of diagnostic plots for a model using ggplot2 and interactive versions of the plots using plotly. ## Installation diff --git a/README.md b/README.md index c48b52d..517e421 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,15 @@ # ggResidpanel + + +[![CRAN +status](https://www.r-pkg.org/badges/version/ggResidpanel)](https://CRAN.R-project.org/package=ggResidpanel) +[![Lifecycle: +stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable) +[![R-CMD-check](https://github.com/goodekat/ggResidpanel/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/goodekat/ggResidpanel/actions/workflows/R-CMD-check.yaml) + + ggResidpanel is an R package for creating panels of diagnostic plots for a model using ggplot2 and interactive versions of the plots using plotly. @@ -30,26 +39,26 @@ library(ggResidpanel) Here are some resources for learning how to use ggResidpanel: -- [Introduction - Vignette](https://goodekat.github.io/ggResidpanel/articles/introduction.html) -- [Tutorial and User - Manual](https://goodekat.github.io/ggResidpanel-tutorial/tutorial.html) +- [Introduction + Vignette](https://goodekat.github.io/ggResidpanel/articles/introduction.html) +- [Tutorial and User + Manual](https://goodekat.github.io/ggResidpanel-tutorial/tutorial.html) ## Overview and Examples The package provides five functions that allow the user to assess diagnostic plots from a model. These functions are: -- `resid_panel`: Creates a panel of diagnostic plots of the residuals - from a model -- `resid_interact`: Creates an interactive panel of diagnostic plots - of the residuals form a model -- `resid_xpanel`: Creates a panel of diagnostic plots of the predictor - variables -- `resid_compare`: Creates a panel of diagnostic plots from multiple - models -- `resid_auxpanel`: Creates a panel of diagnostic plots for model - types not included in the package +- `resid_panel`: Creates a panel of diagnostic plots of the residuals + from a model +- `resid_interact`: Creates an interactive panel of diagnostic plots of + the residuals form a model +- `resid_xpanel`: Creates a panel of diagnostic plots of the predictor + variables +- `resid_compare`: Creates a panel of diagnostic plots from multiple + models +- `resid_auxpanel`: Creates a panel of diagnostic plots for model types + not included in the package Currently, ggResidpanel allows the first four functions listed above to work with models fit using the functions of `lm`, `glm`, `lme` (from diff --git a/man/figures/readme-unnamed-chunk-4-1.png b/man/figures/readme-unnamed-chunk-4-1.png index e766d40..97aa070 100644 Binary files a/man/figures/readme-unnamed-chunk-4-1.png and b/man/figures/readme-unnamed-chunk-4-1.png differ diff --git a/man/figures/readme-unnamed-chunk-4-2.png b/man/figures/readme-unnamed-chunk-4-2.png index d1375e0..024956c 100644 Binary files a/man/figures/readme-unnamed-chunk-4-2.png and b/man/figures/readme-unnamed-chunk-4-2.png differ diff --git a/man/figures/readme-unnamed-chunk-4-3.png b/man/figures/readme-unnamed-chunk-4-3.png index 4035f73..2156835 100644 Binary files a/man/figures/readme-unnamed-chunk-4-3.png and b/man/figures/readme-unnamed-chunk-4-3.png differ diff --git a/man/figures/readme-unnamed-chunk-6-1.png b/man/figures/readme-unnamed-chunk-6-1.png index 1a9433d..b9a02af 100644 Binary files a/man/figures/readme-unnamed-chunk-6-1.png and b/man/figures/readme-unnamed-chunk-6-1.png differ diff --git a/man/figures/readme-unnamed-chunk-6-2.png b/man/figures/readme-unnamed-chunk-6-2.png index 6cb368c..60572c5 100644 Binary files a/man/figures/readme-unnamed-chunk-6-2.png and b/man/figures/readme-unnamed-chunk-6-2.png differ diff --git a/man/figures/readme-unnamed-chunk-7-1.png b/man/figures/readme-unnamed-chunk-7-1.png index 8a5fe27..8437849 100644 Binary files a/man/figures/readme-unnamed-chunk-7-1.png and b/man/figures/readme-unnamed-chunk-7-1.png differ diff --git a/man/figures/readme-unnamed-chunk-8-1.png b/man/figures/readme-unnamed-chunk-8-1.png index bfecd9a..9d3a120 100644 Binary files a/man/figures/readme-unnamed-chunk-8-1.png and b/man/figures/readme-unnamed-chunk-8-1.png differ