I have a variable (a column) with names and surnames. I want to eliminate the space between the name and the last name.
How can I do it, without converting all the fields of my matrix into factors?
I have a variable (a column) with names and surnames. I want to eliminate the space between the name and the last name.
How can I do it, without converting all the fields of my matrix into factors?
It can help you gsub(" ", "", tu_string)
.
This function replaces matches within a chain. The first parameter is what you want to replace, in this case the blank space " "
, the second parameter is because value you want to replace the first, in this case ""
and the third is your string.
I leave a link with more examples about this function, it is in English but the google translator is enough to understand.