标签: r gsub
我有以下字符串,我想用这种模式替换空格(包括两边的双引号) - “,”
s <- "-122.1817252 -119.4179324 -95.7128910" s <- gsub(" ", "\",\"",s) s
但是我得到以下输出 - 用斜杠
> s [1] "-122.1817252\",\"-119.4179324\",\"-95.7128910"
如何删除斜杠以使输出类似
"-122.1817252","-119.4179324","-95.7128910"