我有一个看起来像这样的载体
vector = c('hello, how are you, I am good',
'the sky is blue, isnt that nice')
我想删除每个内容中的空格。 '以逗号后来的
即。输出应该如下:
'hello,how are you,I am good','the sky is blue,isnt that nice'
答案 0 :(得分:2)
要关闭此问题:
gsub(", +", ",", vector)