I can't reproduce your issue, the code works as expected with your sample data, and you are not actually showing a reproducible example of your issue.
library(dplyr)
library(tidyr)
employee <- data.frame(
stringsAsFactors = FALSE,
id = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
first_name = c("John","Rob","Rachel",
"Christy","Johnson","Candace","Carlson","Pansy","Darius",
"Claudia"),
last_name = c("Mendes","Stewart",
"Abrahamson","Hickman","Harper","Miller","Landy","Jordan",
"Berry","Garcia"),
job_title = c("Professional","Programmer",
"Management","Clerical","Developer","Programmer",
"Management","Clerical","Developer","Programmer")
)
employee %>%
unite(name, first_name, last_name, sep = " ")
#> id name job_title
#> 1 1 John Mendes Professional
#> 2 2 Rob Stewart Programmer
#> 3 3 Rachel Abrahamson Management
#> 4 4 Christy Hickman Clerical
#> 5 5 Johnson Harper Developer
#> 6 6 Candace Miller Programmer
#> 7 7 Carlson Landy Management
#> 8 8 Pansy Jordan Clerical
#> 9 9 Darius Berry Developer
#> 10 10 Claudia Garcia Programmer
Created on 2022-06-23 by the reprex package (v2.0.1)
Can you try again to make a reproducible example that actually shows your problem?