From the course: Data Wrangling in R
Unlock the full course today
Join today to access over 24,000 courses taught by industry experts.
Segmenting the coal dataset
From the course: Data Wrangling in R
Segmenting the coal dataset
- [Instructor] Let's take a deeper dive into the regions variable in this data set. When I looked at this file in Excel earlier I noticed that it had a combination of countries and regions. I don't want to have those included in the same table in my tidy data dataset because they represent different types of observations. Remember one of the rules of tidy data is that each tibble should contain information about a single observational unit, combining countries and continents mixes observational units and that could cause us problems. For example, if I tried to total up the coal consumption in this dataset, I'd wind up getting double the real number because each country's coal consumption would be counted twice. Once as a country and once as a continent. So to get started, let's take a look at all the unique values of the regions variable. I'm going to apply the unique function to coal underscore long dollar sign region.…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.