 So R also includes some functions that would allow us to basically convert factors to a different type of data. So I mentioned earlier that when we use this, when we create this vector using this factor function, it's going to store that vector as a factor, even though it contains these string data. So what if we wanted now to convert the values in this vector back to the character data type? We can do that with the as character function. And then within those parentheses, we just throw in the name of the variable, the factor variable. And when you do this, it's now going to print that vector out again. And now there are four elements, not just those two levels, and they're all stored as strings. And there are also some similar functions that we can use, for instance, to convert one data type to numeric. So if I had, let's say, some categorical data like years, birth, birth years, I can convert those back to numbers using as numeric. Or again, if you had something and you wanted to create a factor from it, you could use the as factor argument. Because of the kind of unique properties of factors specifically that are stored as integers instead of the actual values that we're inputting, some weird things can happen. And to highlight these kinds of issues, we're going to create a new variable here called a years factor. Again, we're going to create a new vector using the combined function inside the factor argument. And here we're going to provide a list of years. So this list is 1990, 1983, 1977, 1998, and one more 1999. If we were to check the levels here, we're going to see that we have four levels, because 1990 repeats. So now what would happen if we ran this new variable through our as numeric? Okay, we basically want to convert this from a factor back to a number. What's going to happen? All right, when I run this, you can see now that the output is three, two, one, four, three. Okay, so now instead of getting those dates, I've got this list of integers, this numeric data type. But instead of storing the actual values here, it's stored the integers that are used to code those values. Okay, so in other words, my data has been changed. And if I wasn't paying really close attention, I might have missed this. And then any kind of subsequent calculations or analysis that I was doing would be affected. So how do we get around this? The thing that we're going to need to do, and this might be a bit counterintuitive, is to convert these factors first into a text data type, a character data type. Okay, and then I'm going to convert it to a numeric data type. And the way to do that again is to embed these functions, one inside the other. So within the as numeric function, I'm going to throw as character in there, and then my variable name. So reading from the inside out, this is going to first take this factor variable, convert it to a character. So all these will now be stored as strings. And then it's going to take the output of that function and run it through the as numeric function, again, and convert those strings back to numbers. And when I do this, now you can see that we have a numeric data type here, and we have all five of our values that are actually correct.