I have a question about removing spaces inside character text inside a column data frame. This is my data frame column:
head(data$HO)
[1] "Lidar; Wind field; Temperature; Aerosol; Fabry-Perot etalon"
[2] "Compressive ghost imaging; Guided filter; Single-pixel imaging"
This question is different from this link , because I want to remove only spaces after the ";" character, so the output should look like this:
head(data$HO)
[1] "Lidar;Wind field;Temperature;Aerosol;Fabry-Perot etalon"
[2] "Compressive ghost imaging;Guided filter;Single-pixel imaging"
I tried
data$HO <- gsub("\\;s", ";",data$HO)
but that will not work.
Any suggestion?
source
share