From the course: Data Wrangling in R
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Converting temperature from Fahrenheit to Celsius
From the course: Data Wrangling in R
Converting temperature from Fahrenheit to Celsius
- [Instructor] In the last video, we cleaned up some outlier data points, but we still have one messy element. There are temperatures recorded in both Fahrenheit and Celsius. We should really clean those up so we can perform analysis on measurements taken on the same scale. So I'm going to convert the small number of Fahrenheit records that I have to Celsius. Let's begin by finding the Fahrenheit values in the data set. I can use the which function applied to the filtered water unit field to look for cases where that field is equal two degrees Fahrenheit. And what this function returns is a vector containing the row numbers, where we have the degrees Fahrenheit listed. And actually I'm going to go ahead and convert those to degrees Celsius. So I'm going to store this vector in an object called Fahrenheit where I can reference it later. And then I'm going to convert those to Celsius by taking the filtered water result…
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)
-
-