From the course: Data Wrangling in R
Unlock the full course today
Join today to access over 24,200 courses taught by industry experts.
Widening the water quality dataset
From the course: Data Wrangling in R
Widening the water quality dataset
- [Instructor] The last test that we have before declaring our dataset tidy is moving the measurements about water temperature and pH from the same time and location into a single row. I'm going to begin that by first taking another look at the dataset here and realizing that I have two extraneous columns. We no longer need Parameter Type which we use to do some earlier filtering. And we also no longer need Unit, because we're down to common units. I can remove both of those using the Select function. So I'm going to do that by taking the filtered water dataset and overriding it with a copy of itself, piped to select. And then I can use the select minus format, select minus parameter type to remove parameter type and then minus unit to remove unit. And when I look at a summary of this again, I see that I'm now down to just those five variables that I'm interested in. So now let's jump right in and try pivot wider.…
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.
Contents
-
-
-
-
-
-
-
-
-
(Locked)
Understanding the water quality dataset1m 32s
-
(Locked)
Reading in the water quality dataset1m 35s
-
(Locked)
Filtering the water quality dataset5m 17s
-
(Locked)
Water quality data types3m 2s
-
(Locked)
Correcting data entry errors2m 43s
-
(Locked)
Identifying and removing outliers3m 42s
-
(Locked)
Converting temperature from Fahrenheit to Celsius2m 20s
-
(Locked)
Widening the water quality dataset4m 33s
-
(Locked)
-
-