Skip to content
R for the Rest of Us Logo

Going Deeper with R (RStudio)

Tidy Data Rule #2: Every Row is an Observation

Transcript

Click on the transcript to go to that point in the video. Please note that transcripts are auto generated and may contain minor inaccuracies.

View code shown in video
activities_survey |> 
  separate_longer_delim(cols = activities,
                        delim = ", ")

Your Turn

Run the following code to view the built-in gss_cat data frame.

library(tidyverse)

gss_cat |> 
  view()

Then, write code to count the number of unique responses in the partyid variable.

You’ll need to use the separate_longer_delim() and count() functions to do this.

Learn More

This lesson from the R for Social Scientists course materials covers separate_longer_delim().

Have any questions? Put them below and we will help you out!

You need to be signed-in to comment on this post. Login.

Course Content

44 Lessons