diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index ab1e0cb..69cfc6a 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -8,9 +8,10 @@ on: push: branches: [main, master] pull_request: - branches: [main, master] -name: R-CMD-check +name: R-CMD-check.yaml + +permissions: read-all jobs: R-CMD-check: @@ -25,20 +26,22 @@ jobs: - {os: macos-latest, r: 'release'} - {os: windows-latest, r: 'release'} + # use 4.0 or 4.1 to check with rtools40's older compiler + - {os: windows-latest, r: 'oldrel-4'} - # 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: '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: actions/checkout@v4 - uses: r-lib/actions/setup-pandoc@v2 @@ -56,3 +59,4 @@ jobs: - 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/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 087f0b0..bfc9f4d 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -4,12 +4,13 @@ on: push: branches: [main, master] pull_request: - branches: [main, master] release: types: [published] workflow_dispatch: -name: pkgdown +name: pkgdown.yaml + +permissions: read-all jobs: pkgdown: @@ -19,8 +20,10 @@ jobs: group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + permissions: + contents: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-pandoc@v2 @@ -39,7 +42,7 @@ jobs: - name: Deploy to GitHub pages 🚀 if: github.event_name != 'pull_request' - uses: JamesIves/github-pages-deploy-action@v4.4.1 + uses: JamesIves/github-pages-deploy-action@v4.5.0 with: clean: false branch: gh-pages diff --git a/.github/workflows/pr-commands.yaml b/.github/workflows/pr-commands.yaml index 71f335b..2edd93f 100644 --- a/.github/workflows/pr-commands.yaml +++ b/.github/workflows/pr-commands.yaml @@ -4,7 +4,9 @@ on: issue_comment: types: [created] -name: Commands +name: pr-commands.yaml + +permissions: read-all jobs: document: @@ -13,8 +15,10 @@ jobs: runs-on: ubuntu-latest env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + permissions: + contents: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/pr-fetch@v2 with: @@ -50,8 +54,10 @@ jobs: runs-on: ubuntu-latest env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + permissions: + contents: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/pr-fetch@v2 with: diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 2c5bb50..0ab748d 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -4,9 +4,10 @@ on: push: branches: [main, master] pull_request: - branches: [main, master] -name: test-coverage +name: test-coverage.yaml + +permissions: read-all jobs: test-coverage: @@ -15,7 +16,7 @@ jobs: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-r@v2 with: @@ -23,28 +24,39 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: - extra-packages: any::covr + extra-packages: any::covr, any::xml2 needs: coverage - name: Test coverage run: | - covr::codecov( + cov <- covr::package_coverage( quiet = FALSE, clean = FALSE, - install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package") + install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") ) + print(cov) + covr::to_cobertura(cov) shell: Rscript {0} + - uses: codecov/codecov-action@v5 + 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 }} + files: ./cobertura.xml + plugins: 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 + find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true shell: bash - name: Upload test results if: failure() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: coverage-test-failures path: ${{ runner.temp }}/package diff --git a/DESCRIPTION b/DESCRIPTION index 99fec67..74fca12 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: corrr Title: Correlations in R -Version: 0.4.4.9000 +Version: 0.4.5 Authors@R: c( person("Max", "Kuhn", , "max@rstudio.com", role = c("aut", "cre")), person("Simon", "Jackson", role = "aut"), @@ -40,5 +40,5 @@ VignetteBuilder: Config/Needs/website: tidyverse/tidytemplate Encoding: UTF-8 Roxygen: list(markdown = TRUE) -RoxygenNote: 7.2.1.9000 +RoxygenNote: 7.3.2 Config/testthat/edition: 3 diff --git a/NEWS.md b/NEWS.md index 75a66ff..684f115 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,6 @@ -# corrr (development version) +# corrr 0.4.5 + +- Maintenance release for broken code links. # corrr 0.4.4 diff --git a/R/output.R b/R/output.R index 099081a..cd8bf76 100644 --- a/R/output.R +++ b/R/output.R @@ -79,7 +79,7 @@ fashion.default <- function(x, decimals = 2, leading_zeros = FALSE, na_print = " #' that can be coerced to one (see \code{\link{as_cordf}}). #' @param legend Boolean indicating whether a legend mapping the colors to the #' correlations should be displayed. -#' @param shape \code{\link{geom_point}} aesthetic. +#' @param shape [ggplot2::geom_point()] aesthetic. #' @param print_cor Boolean indicating whether the correlations should be #' printed over the shapes. #' @param colours,colors Vector of colors to use for n-color gradient. diff --git a/README.Rmd b/README.Rmd index dca9d76..573a6d6 100644 --- a/README.Rmd +++ b/README.Rmd @@ -17,7 +17,7 @@ knitr::opts_chunk$set( [![R-CMD-check](https://github.com/tidymodels/corrr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/tidymodels/corrr/actions/workflows/R-CMD-check.yaml) [![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/corrr)](https://cran.r-project.org/package=corrr) -[![Codecov test coverage](https://codecov.io/gh/tidymodels/corrr/branch/main/graph/badge.svg)](https://app.codecov.io/gh/tidymodels/corrr?branch=main) +[![Codecov test coverage](https://codecov.io/gh/tidymodels/corrr/graph/badge.svg)](https://app.codecov.io/gh/tidymodels/corrr) corrr is a package for exploring **corr**elations in **R**. It focuses on creating and working with **data frames** of correlations (instead of matrices) that can be easily explored via corrr functions or by leveraging tools like those in the [tidyverse](https://www.tidyverse.org/). This, along with the primary corrr functions, is represented below: @@ -134,7 +134,7 @@ datasets::airquality %>% This project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/1/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms. -- For questions and discussions about tidymodels packages, modeling, and machine learning, please [post on RStudio Community](https://community.rstudio.com/new-topic?category_id=15&tags=tidymodels,question). +- For questions and discussions about tidymodels packages, modeling, and machine learning, please [post on RStudio Community](https://forum.posit.co/new-topic?category_id=15&tags=tidymodels,question). - If you think you have encountered a bug, please [submit an issue](https://github.com/tidymodels/corrr/issues). diff --git a/README.md b/README.md index 856143e..626ffac 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ [![R-CMD-check](https://github.com/tidymodels/corrr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/tidymodels/corrr/actions/workflows/R-CMD-check.yaml) [![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/corrr)](https://cran.r-project.org/package=corrr) [![Codecov test -coverage](https://codecov.io/gh/tidymodels/corrr/branch/main/graph/badge.svg)](https://app.codecov.io/gh/tidymodels/corrr?branch=main) +coverage](https://codecov.io/gh/tidymodels/corrr/graph/badge.svg)](https://app.codecov.io/gh/tidymodels/corrr) corrr is a package for exploring **corr**elations in **R**. It focuses @@ -22,13 +22,13 @@ corrr functions, is represented below: You can install: -- the latest released version from CRAN with +- the latest released version from CRAN with ``` r install.packages("corrr") ``` -- the latest development version from GitHub with +- the latest development version from GitHub with ``` r # install.packages("remotes") @@ -42,10 +42,10 @@ base correlation function `cor()`. It differs by defaulting to pairwise deletion, and returning a correlation data frame (`cor_df`) of the following structure: -- A `tbl` with an additional class, `cor_df` -- An extra “term” column -- Standardized variances (the matrix diagonal) set to missing values - (`NA`) so they can be ignored. +- A `tbl` with an additional class, `cor_df` +- An extra “term” column +- Standardized variances (the matrix diagonal) set to missing values + (`NA`) so they can be ignored. ### API @@ -57,19 +57,19 @@ purposes: Internal changes (`cor_df` out): -- `shave()` the upper or lower triangle (set to NA). -- `rearrange()` the columns and rows based on correlation strengths. +- `shave()` the upper or lower triangle (set to NA). +- `rearrange()` the columns and rows based on correlation strengths. Reshape structure (`tbl` or `cor_df` out): -- `focus()` on select columns and rows. -- `stretch()` into a long format. +- `focus()` on select columns and rows. +- `stretch()` into a long format. Output/visualizations (console/plot out): -- `fashion()` the correlations for pretty printing. -- `rplot()` the correlations with shapes in place of the values. -- `network_plot()` the correlations in a network. +- `fashion()` the correlations for pretty printing. +- `rplot()` the correlations with shapes in place of the values. +- `network_plot()` the correlations in a network. ## Databases and Spark @@ -167,6 +167,7 @@ rplot(x) ![](man/figures/README-combination-1.png) ``` r + datasets::airquality %>% correlate() %>% network_plot(min_cor = .2) @@ -183,18 +184,18 @@ This project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/1/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms. -- For questions and discussions about tidymodels packages, modeling, - and machine learning, please [post on RStudio - Community](https://community.rstudio.com/new-topic?category_id=15&tags=tidymodels,question). +- For questions and discussions about tidymodels packages, modeling, and + machine learning, please [post on RStudio + Community](https://forum.posit.co/new-topic?category_id=15&tags=tidymodels,question). -- If you think you have encountered a bug, please [submit an - issue](https://github.com/tidymodels/corrr/issues). +- If you think you have encountered a bug, please [submit an + issue](https://github.com/tidymodels/corrr/issues). -- Either way, learn how to create and share a - [reprex](https://reprex.tidyverse.org/articles/articles/learn-reprex.html) - (a minimal, reproducible example), to clearly communicate about your - code. +- Either way, learn how to create and share a + [reprex](https://reprex.tidyverse.org/articles/articles/learn-reprex.html) + (a minimal, reproducible example), to clearly communicate about your + code. -- Check out further details on [contributing guidelines for tidymodels - packages](https://www.tidymodels.org/contribute/) and [how to get - help](https://www.tidymodels.org/help/). +- Check out further details on [contributing guidelines for tidymodels + packages](https://www.tidymodels.org/contribute/) and [how to get + help](https://www.tidymodels.org/help/). diff --git a/man/figures/README-combination-1.png b/man/figures/README-combination-1.png index 5aff03d..83a6302 100644 Binary files a/man/figures/README-combination-1.png and b/man/figures/README-combination-1.png differ diff --git a/man/figures/README-combination-2.png b/man/figures/README-combination-2.png index 5e407bb..04ad655 100644 Binary files a/man/figures/README-combination-2.png and b/man/figures/README-combination-2.png differ diff --git a/man/rplot.Rd b/man/rplot.Rd index f0811e1..d37c525 100644 --- a/man/rplot.Rd +++ b/man/rplot.Rd @@ -21,7 +21,7 @@ that can be coerced to one (see \code{\link{as_cordf}}).} \item{legend}{Boolean indicating whether a legend mapping the colors to the correlations should be displayed.} -\item{shape}{\code{\link{geom_point}} aesthetic.} +\item{shape}{\code{\link[ggplot2:geom_point]{ggplot2::geom_point()}} aesthetic.} \item{colours, colors}{Vector of colors to use for n-color gradient.} diff --git a/vignettes/using-corrr.Rmd b/vignettes/using-corrr.Rmd index f8eb73d..4c2373a 100644 --- a/vignettes/using-corrr.Rmd +++ b/vignettes/using-corrr.Rmd @@ -121,4 +121,4 @@ d %>% ## Other Resources -For other resources about how to use `corrr`, you'll find plenty of posts explaining functions at [blogR](https://drsimonj.svbtle.com/), or keep up to date with these on Twitter by following [\@drsimonj](https://twitter.com/drsimonj). +For other resources about how to use `corrr`, you'll find plenty of posts explaining functions at [blogR](https://drsimonj.svbtle.com/).