How to replace space in string if string have more than one space. for example i have data frame on names column, name is like last name then "," and first name and if there is space more than one then it should replace by single space.
df7 <- data.frame(name = c("ttt, hbue","mna, huna","vga, pahk","hja, dhyn","cct, indo","nhu, nhuv"))
the data frame have two or three spaces in between first name and second name and i want to replace spaces with single space