Regex 如何删除逗号后出现的空白

Regex 如何删除逗号后出现的空白,regex,r,string,trim,Regex,R,String,Trim,我有一个像这样的向量 vector = c('hello, how are you, I am good', 'the sky is blue, isnt that nice') 我要删除每个“”中逗号后的空格 i、 e.输出应如下所示: 'hello,how are you,I am good','the sky is blue,isnt that nice' 要结束此问题,请执行以下操作: gsub(", +", ",", vector) gsub(“,\\s”

我有一个像这样的向量

vector = c('hello, how are you, I am good', 
           'the sky is blue, isnt that nice')
我要删除每个“”中逗号后的空格

i、 e.输出应如下所示:

'hello,how are you,I am good','the sky is blue,isnt that nice'

要结束此问题,请执行以下操作:

gsub(", +", ",", vector)
gsub(“,\\s”,“,”,vector)
或者只是为了好玩
gsub((?)?