{"id":13654035,"url":"https://github.com/tidyverse/tidyr","last_synced_at":"2025-05-15T00:05:41.256Z","repository":{"id":39013784,"uuid":"20688261","full_name":"tidyverse/tidyr","owner":"tidyverse","description":"Tidy Messy Data","archived":false,"fork":false,"pushed_at":"2025-03-03T19:50:08.000Z","size":20655,"stargazers_count":1394,"open_issues_count":55,"forks_count":415,"subscribers_count":70,"default_branch":"main","last_synced_at":"2025-05-03T02:13:39.341Z","etag":null,"topics":["r","tidy-data"],"latest_commit_sha":null,"homepage":"https://tidyr.tidyverse.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/tidyverse.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":".github/CODEOWNERS","security":null,"support":".github/SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-06-10T14:24:33.000Z","updated_at":"2025-04-28T19:21:39.000Z","dependencies_parsed_at":"2023-12-16T07:04:51.790Z","dependency_job_id":"1d3cd8b5-e873-470c-8b9f-92c8253ca33f","html_url":"https://github.com/tidyverse/tidyr","commit_stats":{"total_commits":1314,"total_committers":134,"mean_commits":9.805970149253731,"dds":0.410958904109589,"last_synced_commit":"c6c126a61f67a10b5ab9ce6bb1d9dbbb7a380bbd"},"previous_names":["hadley/tidyr"],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidyverse%2Ftidyr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidyverse%2Ftidyr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidyverse%2Ftidyr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidyverse%2Ftidyr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tidyverse","download_url":"https://codeload.github.com/tidyverse/tidyr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252873953,"owners_count":21817708,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["r","tidy-data"],"created_at":"2024-08-02T02:01:22.308Z","updated_at":"2025-05-07T11:51:38.055Z","avatar_url":"https://github.com/tidyverse.png","language":"R","funding_links":[],"categories":["Table of Contents","R"],"sub_categories":["Data manipulation"],"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 = \"README-\"\n)\n```\n\n# tidyr \u003ca href=\"https://tidyr.tidyverse.org\"\u003e\u003cimg src=\"man/figures/logo.png\" align=\"right\" height=\"138\" alt=\"tidyr website\" /\u003e\u003c/a\u003e\n\n\u003c!-- badges: start --\u003e\n[![CRAN status](https://www.r-pkg.org/badges/version/tidyr)](https://cran.r-project.org/package=tidyr)\n[![R-CMD-check](https://github.com/tidyverse/tidyr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/tidyverse/tidyr/actions/workflows/R-CMD-check.yaml)\n[![Codecov test coverage](https://codecov.io/gh/tidyverse/tidyr/branch/main/graph/badge.svg)](https://app.codecov.io/gh/tidyverse/tidyr?branch=main)\n\u003c!-- badges: end --\u003e\n  \n## Overview\n\nThe goal of tidyr is to help you create __tidy data__. Tidy data is data where:\n\n1. Each variable is a column; each column is a variable.\n1. Each observation is a row; each row is an observation.\n1. Each value is a cell; each cell is a single value.\n\nTidy data describes a standard way of storing data that is used wherever possible throughout the [tidyverse](https://www.tidyverse.org/). If you ensure that your data is tidy, you'll spend less time fighting with the tools and more time working on your analysis. Learn more about tidy data in `vignette(\"tidy-data\")`.\n\n## Installation\n\n```{r, eval = FALSE}\n# The easiest way to get tidyr is to install the whole tidyverse:\ninstall.packages(\"tidyverse\")\n\n# Alternatively, install just tidyr:\ninstall.packages(\"tidyr\")\n\n# Or the development version from GitHub:\n# install.packages(\"pak\")\npak::pak(\"tidyverse/tidyr\")\n```\n\n## Cheatsheet\n\n\u003ca href=\"https://github.com/rstudio/cheatsheets/blob/master/tidyr.pdf\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/rstudio/cheatsheets/master/pngs/thumbnails/tidyr-thumbs.png\" width=\"630\" height=\"252\"/\u003e\u003c/a\u003e  \n\n## Getting started\n\n```{r}\nlibrary(tidyr)\n```\n\ntidyr functions fall into five main categories:\n\n* \"Pivoting\" which converts between long and wide forms. tidyr 1.0.0 \n  introduces `pivot_longer()` and `pivot_wider()`, replacing the older \n  `spread()` and `gather()` functions. See `vignette(\"pivot\")` for more \n  details.\n  \n* \"Rectangling\", which turns deeply nested lists (as from JSON) into tidy\n  tibbles. See `unnest_longer()`, `unnest_wider()`, `hoist()`, and \n  `vignette(\"rectangle\")` for more details.\n  \n* Nesting converts grouped data to a form where each group becomes a\n  single row containing a nested data frame, and unnesting does the opposite.\n  See `nest()`, `unnest()`, and  `vignette(\"nest\")` for more details.\n\n* Splitting and combining character columns. Use `separate_wider_delim()`,\n  `separate_wider_position()`, and `separate_wider_regex()` to pull a single\n  character column into multiple columns; use `unite()` to combine multiple\n  columns into a single character column.\n\n* Make implicit missing values explicit with `complete()`; make explicit \n  missing values implicit with `drop_na()`; replace missing values with\n  next/previous value with `fill()`, or a known value with `replace_na()`.\n\n## Related work\n\ntidyr [supersedes](https://lifecycle.r-lib.org/articles/stages.html#superseded) reshape2 (2010-2014) and reshape (2005-2010). Somewhat counterintuitively, each iteration of the package has done less. tidyr is designed specifically for tidying data, not general reshaping (reshape2), or the general aggregation (reshape). \n\n[data.table](https://rdatatable.gitlab.io/data.table) provides high-performance implementations of `melt()` and `dcast()`\n\nIf you'd like to read more about data reshaping from a CS perspective, I'd recommend the following three papers:\n\n* [Wrangler: Interactive visual specification of data transformation scripts](http://vis.stanford.edu/papers/wrangler)\n\n* [An interactive framework for data cleaning](https://www2.eecs.berkeley.edu/Pubs/TechRpts/2000/CSD-00-1110.pdf) (Potter's wheel)\n\n* [On efficiently implementing SchemaSQL on a SQL database system](https://www.vldb.org/conf/1999/P45.pdf)\n\nTo guide your reading, here's a translation between the terminology used in different places:\n\n| tidyr 1.0.0       | pivot longer | pivot wider |\n|-------------------|--------------|-------------|\n| tidyr \u003c 1.0.0     | gather       | spread      |\n| reshape(2)        | melt         | cast        |\n| spreadsheets      | unpivot      | pivot       | \n| databases         | fold         | unfold      |\n\n## Getting help\n\nIf you encounter a clear bug, please file a minimal reproducible example on [github](https://github.com/tidyverse/tidyr/issues). For questions and other discussion, please use [forum.posit.co](https://forum.posit.co/).\n\n---\n\nPlease note that the tidyr project is released with a [Contributor Code of Conduct](https://tidyr.tidyverse.org/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftidyverse%2Ftidyr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftidyverse%2Ftidyr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftidyverse%2Ftidyr/lists"}