我想在一组可能略有不同的字符串上使用gsub;R gsub多个条件
I went to the store last night
I went to the park yesterday
I went to starbucks this morning
我需要使用GSUB来代替“我去......”,但有时会有一个“的”,有时也不会
这样的事情,但以下将无法正常工作
gsub('i went to [the|a-z]','REPLACED',string)
REPLACED last night
REPLACED yesterday
REPLACED this morning
像这样的东西? 'gsub(“我去了*(store | park | starbucks)”,“REPLACED”,data)' – FisherDisinformation
@ user2100721他把它放在我相信的第二个代码块中。 – FisherDisinformation
@ user2100721它在第二个块中。谢谢 – chattrat423