Skip to content
This repository has been archived by the owner on Aug 4, 2020. It is now read-only.

tidyr - very important package for data analysis #76

Open
durrantmm opened this issue Oct 6, 2017 · 2 comments
Open

tidyr - very important package for data analysis #76

durrantmm opened this issue Oct 6, 2017 · 2 comments

Comments

@durrantmm
Copy link

It's hard to overstate how important it is to understand what it means for data to be 'tidy'. Tidy data is an important concept if you want to make the most of many other features of R, such as ggplot2 and dplyr. An introduction to tidy data and the tidyr package can be found here.

Tidy data is generally not the way that we intuitively think about organizing data. When data is considered 'tidy', it generally follows this pattern:

  • Each column is a variable
  • Each row is an observation.

tidyr has two functions that improve upon the well known reshape2 functions cast() and melt(). The analog of cast() is called spread() and the analog of melt() is gather(). It also contains an important function called separate(), which takes a given column in R and is able to split it into multiple columns based on a delimiter. This is often necessary when a single data column contains multiple pieces of information, perhaps as a type of ID.

Learning the basics of tidy data and the tidyr package will greatly benefit our students.

@mfoos
Copy link

mfoos commented Oct 21, 2017

I support this! And I want to suggest that the example be data that needs to be plotted [with ggplot2], so there's a big payoff. I think if you've never tried to wrestle already-rectangular data for a reason the whole long/wide distinction is hard to appreciate.

@fmichonneau fmichonneau added type:discussion Discussion or feedback about the lesson and removed discussion labels Jun 8, 2018
@gabrielodom
Copy link

I'm new to the Carpentries, and I'm looking for a place to help. How can I help here?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants