Nice job! Now we have all the columns in a workable format. It's time to look at some of them a bit closer.
As you can see, we have first names and last names combined into one column. We need to separate them. We can do this using the
If we wanted to do the same with our email addresses, we'd use
separate() from the
tidyr package, like this:
survey <- separate(
The arguments are the data set (
survey), the column we want to separate (passed as the
col argument), the separator we want to use (passed as the
sep argument), and the vector of new columns' names. By default, the
separate() function removes the old column and adds new ones.