{"id":13545726,"url":"https://github.com/tidymodels/corrr","last_synced_at":"2026-03-17T16:03:39.399Z","repository":{"id":36910554,"uuid":"61860920","full_name":"tidymodels/corrr","owner":"tidymodels","description":"Explore correlations in R","archived":false,"fork":false,"pushed_at":"2025-11-08T05:06:18.000Z","size":81348,"stargazers_count":591,"open_issues_count":22,"forks_count":58,"subscribers_count":17,"default_branch":"main","last_synced_at":"2025-12-13T03:08:43.031Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://corrr.tidymodels.org","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tidymodels.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2016-06-24T06:09:09.000Z","updated_at":"2025-12-06T06:41:33.000Z","dependencies_parsed_at":"2023-01-17T07:09:45.105Z","dependency_job_id":"4041cf58-ca0c-4c3d-8ac7-3d2834110186","html_url":"https://github.com/tidymodels/corrr","commit_stats":{"total_commits":313,"total_committers":20,"mean_commits":15.65,"dds":0.5303514376996805,"last_synced_commit":"bd5841ddcf7f50d824b188b9e007a6069ab1cce7"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/tidymodels/corrr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidymodels%2Fcorrr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidymodels%2Fcorrr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidymodels%2Fcorrr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidymodels%2Fcorrr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tidymodels","download_url":"https://codeload.github.com/tidymodels/corrr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidymodels%2Fcorrr/sbom","scorecard":{"id":884839,"data":{"date":"2025-08-11","repo":{"name":"github.com/tidymodels/corrr","commit":"aa0488f1a26e0e04dda9e08535719e8f6b6f9154"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/R-CMD-check.yaml:1","Warn: no topLevel permission defined: .github/workflows/lock.yaml:1","Warn: no topLevel permission defined: .github/workflows/pkgdown.yaml:1","Warn: no topLevel permission defined: .github/workflows/pr-commands.yaml:1","Warn: no topLevel permission defined: .github/workflows/test-coverage.yaml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":4,"reason":"Found 7/16 approved changesets -- score normalized to 4","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/R-CMD-check.yaml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/tidymodels/corrr/R-CMD-check.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/R-CMD-check.yaml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/tidymodels/corrr/R-CMD-check.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/R-CMD-check.yaml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/tidymodels/corrr/R-CMD-check.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/R-CMD-check.yaml:51: update your workflow using https://app.stepsecurity.io/secureworkflow/tidymodels/corrr/R-CMD-check.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/R-CMD-check.yaml:56: update your workflow using https://app.stepsecurity.io/secureworkflow/tidymodels/corrr/R-CMD-check.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/lock.yaml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/tidymodels/corrr/lock.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pkgdown.yaml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/tidymodels/corrr/pkgdown.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pkgdown.yaml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/tidymodels/corrr/pkgdown.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pkgdown.yaml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/tidymodels/corrr/pkgdown.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pkgdown.yaml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/tidymodels/corrr/pkgdown.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pkgdown.yaml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/tidymodels/corrr/pkgdown.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pr-commands.yaml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/tidymodels/corrr/pr-commands.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-commands.yaml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/tidymodels/corrr/pr-commands.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-commands.yaml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/tidymodels/corrr/pr-commands.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-commands.yaml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/tidymodels/corrr/pr-commands.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-commands.yaml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/tidymodels/corrr/pr-commands.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pr-commands.yaml:54: update your workflow using https://app.stepsecurity.io/secureworkflow/tidymodels/corrr/pr-commands.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-commands.yaml:56: update your workflow using https://app.stepsecurity.io/secureworkflow/tidymodels/corrr/pr-commands.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-commands.yaml:60: update your workflow using https://app.stepsecurity.io/secureworkflow/tidymodels/corrr/pr-commands.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-commands.yaml:77: update your workflow using https://app.stepsecurity.io/secureworkflow/tidymodels/corrr/pr-commands.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-coverage.yaml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/tidymodels/corrr/test-coverage.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test-coverage.yaml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/tidymodels/corrr/test-coverage.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test-coverage.yaml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/tidymodels/corrr/test-coverage.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-coverage.yaml:47: update your workflow using https://app.stepsecurity.io/secureworkflow/tidymodels/corrr/test-coverage.yaml/main?enable=pin","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of  18 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 27 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-24T09:35:47.175Z","repository_id":36910554,"created_at":"2025-08-24T09:35:47.176Z","updated_at":"2025-08-24T09:35:47.176Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30626906,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T14:16:03.965Z","status":"ssl_error","status_checked_at":"2026-03-17T14:16:03.380Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T11:01:12.343Z","updated_at":"2026-03-17T16:03:39.360Z","avatar_url":"https://github.com/tidymodels.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, echo = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\"\n)\n```\n\n# corrr \u003ca href='https://corrr.tidymodels.org'\u003e\u003cimg src='man/figures/logo.png' style='float: right'  height=\"139\" /\u003e\u003c/a\u003e\n\n\u003c!-- badges: start --\u003e\n[![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)\n[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/corrr)](https://cran.r-project.org/package=corrr)\n[![Codecov test coverage](https://codecov.io/gh/tidymodels/corrr/branch/main/graph/badge.svg)](https://app.codecov.io/gh/tidymodels/corrr?branch=main)\n\u003c!-- badges: end --\u003e\n\ncorrr 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:\n\n\u003cimg src='man/figures/to-cor-df.png'\u003e\n\nYou can install:\n\n- the latest released version from CRAN with\n\n```{r install_cran, eval = FALSE}\ninstall.packages(\"corrr\")\n```\n\n- the latest development version from GitHub with\n\n```{r install_git, eval = FALSE}\n# install.packages(\"remotes\") \nremotes::install_github(\"tidymodels/corrr\")\n```\n\n## Using corrr\n\nUsing `corrr` typically starts with `correlate()`, which acts like the base correlation function `cor()`. It differs by defaulting to pairwise deletion, and returning a correlation data frame (`cor_df`) of the following structure:\n\n- A `tbl` with an additional class, `cor_df`\n- An extra \"term\" column\n- Standardized variances (the matrix diagonal) set to missing values (`NA`) so they can be ignored.\n\n### API\n\nThe corrr API is designed with data pipelines in mind (e.g., to use `%\u003e%` from the magrittr package). After `correlate()`, the primary corrr functions take a `cor_df` as their first argument, and return a `cor_df` or `tbl` (or output like a plot). These functions serve one of three purposes:\n\nInternal changes (`cor_df` out):\n\n- `shave()` the upper or lower triangle (set to `r NA`).\n- `rearrange()` the columns and rows based on correlation strengths.\n\nReshape structure (`tbl` or `cor_df` out):\n\n- `focus()` on select columns and rows.\n- `stretch()` into a long format.\n\nOutput/visualizations (console/plot out):\n\n- `fashion()` the correlations for pretty printing.\n- `rplot()` the correlations with shapes in place of the values.\n- `network_plot()` the correlations in a network.\n\n## Databases and Spark\n\nThe `correlate()` function also works with database tables.  The function will automatically push the calculations of the correlations to the database, collect the results in R, and return the `cor_df` object.  This allows for those results integrate with the rest of the `corrr` API.\n\n## Examples\n\n```{r example, message = FALSE, warning = FALSE}\nlibrary(MASS)\nlibrary(corrr)\nset.seed(1)\n\n# Simulate three columns correlating about .7 with each other\nmu \u003c- rep(0, 3)\nSigma \u003c- matrix(.7, nrow = 3, ncol = 3) + diag(3)*.3\nseven \u003c- mvrnorm(n = 1000, mu = mu, Sigma = Sigma)\n\n# Simulate three columns correlating about .4 with each other\nmu \u003c- rep(0, 3)\nSigma \u003c- matrix(.4, nrow = 3, ncol = 3) + diag(3)*.6\nfour \u003c- mvrnorm(n = 1000, mu = mu, Sigma = Sigma)\n\n# Bind together\nd \u003c- cbind(seven, four)\ncolnames(d) \u003c- paste0(\"v\", 1:ncol(d))\n\n# Insert some missing values\nd[sample(1:nrow(d), 100, replace = TRUE), 1] \u003c- NA\nd[sample(1:nrow(d), 200, replace = TRUE), 5] \u003c- NA\n\n# Correlate\nx \u003c- correlate(d)\nclass(x)\nx\n```\n\n**NOTE: Previous to corrr 0.4.3, the first column of a `cor_df` dataframe was named \"rowname\". As of corrr 0.4.3, the name of this first column changed to \"term\".**\n\nAs a `tbl`, we can use functions from data frame packages like `dplyr`, `tidyr`, `ggplot2`:\n\n```{r, message = FALSE, warning = FALSE}\nlibrary(dplyr)\n\n# Filter rows by correlation size\nx %\u003e% filter(v1 \u003e .6)\n```\n\ncorrr functions work in pipelines (`cor_df` in; `cor_df` or `tbl` out):\n\n```{r combination, warning = FALSE, fig.height = 4, fig.width = 5}\nx \u003c- datasets::mtcars %\u003e%\n       correlate() %\u003e%    # Create correlation data frame (cor_df)\n       focus(-cyl, -vs, mirror = TRUE) %\u003e%  # Focus on cor_df without 'cyl' and 'vs'\n       rearrange() %\u003e%  # rearrange by correlations\n       shave() # Shave off the upper triangle for a clean result\n       \nfashion(x)\nrplot(x)\n\ndatasets::airquality %\u003e% \n  correlate() %\u003e% \n  network_plot(min_cor = .2)\n```\n\n## Contributing\n\nThis 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.\n\n- 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\u0026tags=tidymodels,question).\n\n- If you think you have encountered a bug, please [submit an issue](https://github.com/tidymodels/corrr/issues).\n\n- 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.\n\n- 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/).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftidymodels%2Fcorrr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftidymodels%2Fcorrr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftidymodels%2Fcorrr/lists"}