Summer Deals - hours only!Up to 80% off on all courses and bundles.-Close
Changing column data types
3. Convert factors to characters
Basic data cleaning
Summary

Instruction

There is a bit of a mess in these columns!

First of all, the name column is a factor. We don't necessarily need that. Every name doesn't need to be a separate level. It will be easier to work with a column containing characters. We can easily switch the format of the name column to a character data type column by using the function as.character(). This changes the type of the argument to the character data type. In this case, the argument is an entire column. We will just assign the results back to the same column, like this:

survey$name <- as.character(survey$name)

Exercise

It looks like we have the same problem with the email column. Use the as.character() function to change this column to the character data type.