Skip to content
R for the Rest of Us Logo

Bring It All Together (Advanced Data Wrangling)

If the video is not playing correctly, you can watch it in a new window

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
# Load Packages -----------------------------------------------------------

library(tidyverse)
library(janitor)

# Import Data -------------------------------------------------------------

survey_data_raw <- read_tsv("data-raw/2020-combined-survey-final.tsv") |> 
  clean_names() |> 
  mutate(id = row_number())


# Exploration -------------------------------------------------------------

survey_data_raw |> 
  glimpse()

survey_data_raw
count(qr_learning_path) |> 
  arrange(desc(n))


# Tidying -----------------------------------------------------------------

other_coding_languages <- 
  survey_data_raw |> 
  select(id, qcoding_languages) |> 
  separate_longer_delim(qcoding_languages,
                        delim = ", ")

demographics <- survey_data_raw |> 
  select(id, qyear_born:qcountry)


# Export ------------------------------------------------------------------

other_coding_languages |> 
  write_rds("data/other_coding_languages.rds")

demographics |> 
  write_rds("data/demographics.rds")

Learn More

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

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