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

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.…

Contents