Lesson 9 - Prepare Data

What you will learn in this lesson:

β€’ How to rename and drop a column in a data frame.
β€’ How to display the names of the columns in a data frame.
β€’ How to use the pipe operator.
β€’ How to use indentation, and why it makes code easier to debug.
β€’ How to create new columns in a data frame.
β€’ How to merge multiple data frames into one.

In the previous lesson, we imported three files stored in three different variables: gdp_rawpopulation_raw and roads_raw. To continue our work, we need to merge them into a single data frame. Let’s call this unified data frame dep_all. To merge the data frames, we need to structure all three similarly. We will prepare each variable first, and then we will do the merging.

One aspect where the Tidyverse shines is when it comes to importing and preparing data. Almost all the functions we will use in this lesson come from the Tidyverse.