I have used the separate function to split the name column into first_name and last_name, when I run the func:
separate(employee, name, into=c('first_name', 'last_name'), sep=' ')
and it works when the table is produced. They become two different values in my console. But then when I try to reunite them, they say that the first_name and last_name column does not exists even when i have tried them in quotes, single quotes, or just by themselves. Is there a way to get the code for the separated function in order for the values to be applied?
Thank you!!
But then when I try to reunite them, they say that the first_name and last_name column does not exists even when i have tried them in quotes, single quotes, or just by themselves. Is there a way to get the code for the separated function in order for the values to be applied?
Your code works. See below the full code doing what you are describing:
Created on 2022-12-10 with reprex v2.0.2