Join Mike Chapple for an in-depth discussion in this video Making wide data sets long, part of Cleaning Bad Data in R.
- [Narrator] Analysts working in R often find themselves…in the situation where they would like to convert…a wide data set into a longer version.…The gather function makes this easy.…In the last video, we looked at this example…of a Pew Religion data set that is wide,…and described how a data scientist might prefer…to convert it into a longer format.…Let's now take a look at how to perform…this conversion in R.…The tidyr library within the tidyverse contains a function…called gather that takes a wide data set and makes it long…by gathering the information from columns…and putting it into rows.…
The gather function works using…the concept of keys and values.…Value means the same thing that it does…in the world of tidy data.…It's the actual data point in a table…that represents the observation of a single variable.…Keys are a new term to us.…The key is the name used to identify…the variable described by the value.…In the case of making a wide data set long,…the key is usually the column name.…Let's take a look at an example…
Where possible, instructor Mike Chapple shows how to correct the issues using R, but the same principles can be applied to any statistical programing language.
- Missing data
- Duplicate rows and values
- Converting data
- Formatting data
- Working with tidy data
- Tidying data sets
- Dealing with suspicious data
Skill Level Beginner
1. Missing Data
2. Duplicated Data
3. Formatting Data
5. Tidy Data
6. Red Flags
What's next?1m 5s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.