Skip to content
R for the Rest of Us Logo

R in 3 Months Spring 2022 Week 7 Project Assignment

This lesson is locked

Get access to all lessons in this course.

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.

For this week's assignment we're asking you to think about how your dataset(s) tidy... and untidy.

There are two sets of two functions for tidying data from {tidyr}

  • pivot_longer() and pivot_wider() for transforming between wide and long datasets (and back again).

  • separate() and separate_rows() for dealing with columns that contain multiple observations. This is extremely common in survey datasets.

We'd like to see you experiment with using one or more of these functions for tidying your data.

In my example video below I used the United States", "US", "Americas", "United Kingdom", "GB", "Europe", "France", "FR", "Europe", "Germany", "DE", "Europe", "Canada", "CA", "Americas", "Saudi Arabai", "SA", "Asia", "Egypt", "EG", "Africa", "Estonia", "EE", "Europe", "New Zealand", "ZA", "Oceania", "Australia", "AU", "Oceania", "China", "CN", "Asia", "Signapore", "SG", "Asia", "Spain", "ES", "Europe", "Japan", "JO", "Asia" ) wdi_indicators - c("percent_pop_using_internet" = "IT.NET.USER.ZS", "gdp_per_cap" = "NY.GDP.PCAP.KD") WDI(countries_df$country.code, indicator = wdi_indicators) %% as_tibble() ">code you can find in this gist.

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

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