Reshaping Data with tidyr

Start Free Preview

Buying via our links supports this free directory · Affiliate disclosure.
Course facts
  • Payment: Free Preview (Paid Upgrade)
  • Learning style: Self-paced, start anytime
  • Format: Text & Interactive
  • Video access: Streaming Only
  • Before you start: Data Manipulation with dplyr
DataCamp details
  • Chapters: 4
Created byDataCamp
Available onDataCamp

Course Details
Learning Style

Start Anytime

Level

Intermediate

Study Mode

100% Online

Duration

Short (< 10 Hours)

Languages
Audio Language

English

Outcomes
Certificate

Certificate of Completion

Price & Terms
Pricing Model

Free Preview (Paid Upgrade)

Technical
Content Medium

Text & Interactive

Video Access

Streaming Only

Specification
Access

Subscription

SKU: reshaping-data-tidyr Category: Tags: , Brand:

Learn to tidy messy data in R with tidyr: separate columns, pivot between wide and long formats, complete missing rows and unnest JSON.

At a glance
Duration4 hrs
LevelIntermediate
CertificateCertificate of Completion
LanguageEnglish
Taught byJeroen Boeye
AccessSubscription
Add your review
Add to wishlistAdded to wishlistRemoved from wishlist 0
Add to compare

Messy datasets often hide values in column names, pack several variables into one field, leave whole observations out, or arrive as nested files that no flat table can hold. The lessons tackle each of these problems with the tidyr package in R, turning awkward real-world data into tidy tables ready for analysis. Practice data includes Soviet space dogs, Olympic medal counts and Star Wars films, so every technique is tried on a dataset with its own quirks.

What You Will Achieve

  • Split a character column that holds several variables, such as international phone numbers, into separate columns or rows
  • Move values stored in column headers into rows, and spread variables stored in rows back out into columns
  • Fill gaps in counted data and time series so that absent observations appear explicitly in the table
  • Convert nested JSON returned by a web API into a tidy data frame and fit models on nested data


Program Overview

Tidy Data and Messy Columns

Introduces the tidy data structure and shows how to split character columns that hold several variables or values.

  • What makes a dataset tidy
  • Separating values into columns and rows
  • Extracting observations from values
  • Overwriting and removing missing values

Pivoting Between Wide and Long Formats

Uses pivot_longer() and pivot_wider() to pull variables out of column names and to turn row-stored variables into columns.

  • Wide-to-long pivots with pivot_longer()
  • Deriving variables from complex column headers
  • Uncounting observations
  • Long-to-wide pivots and transposing data with pivot_wider()

Expanding and Rectangling Data

Completes datasets with absent observations, then turns nested structures such as JSON and XML into tidy rectangular tables and modeling pipelines.

  • Unique combinations and completing value sets
  • Full time sequences with full_seq()
  • Unnesting and hoisting nested values
  • Nesting tibbles for modeling with broom

Certificate Awarded (Paid)

Complete all the course chapters to earn it.


Job Outlook

Reshaping and wrangling data is routine work in data science and analytics before any analysis or graphing, and rectangling nested files helps developers who handle data returned by web APIs.


Our take

Good for: R users who regularly meet datasets in awkward shapes, including nested JSON from web APIs, and want a repeatable way to tidy them.

Keep in mind: Although labeled intermediate, it starts from the basic idea of tidy data before pivoting and rectangling, and all the practice is in R with tidyverse packages such as tidyr and broom.

Bottom line: Four tightly scoped chapters cover the main reshaping jobs in tidyr, with offbeat practice data that ties each function to a concrete problem.

Frequently Asked Questions

Which tidyr functions handle the pivoting?

The pivoting chapter centers on pivot_longer(), which turns wide data into long data, and pivot_wider(), which does the reverse. It also shows how to derive variables from complex column headers and how to uncount observations.

What kinds of datasets appear in the exercises?

Practice data includes international phone numbers, Oscar best director records, WHO obesity figures, big tech stock prices, New Zealand's bird of the year, planet temperatures, Olympic medals, a virus outbreak and Star Wars films, so each function meets a different kind of messy data.

Can the course help with JSON from web APIs?

Yes. The final chapter turns nested structures such as JSON and XML files into rectangular tables, practicing unnesting and hoisting on Star Wars data, which is the skill needed to process data from web APIs.

How does the course connect tidyr to modeling?

The closing lessons nest tibbles, fit models on nested data frames and use the broom package to turn model output into tidy tables, so the results of a modeling pipeline stay in a tidy format.

User Reviews

0.0 out of 5
★★★★★
0
★★★★★
0
★★★★★
0
★★★★★
0
★★★★★
0

No reviews yet. Be the first to review this course.

There are no reviews yet.

Write your review

Reviews can only be posted by registered learners. Log in or create a free account, then you will return here to post.

×

    Report this page
    Reshaping Data with tidyr
    Reshaping Data with tidyr
    LiveTalent
    Logo
    Compare items
    • Total (0)
    Compare
    0