【发布时间】:2012-12-10 08:25:12
【问题描述】:
我有一个类似的代码(我知道了here):
m<- c("Hello! #London is gr8. I really likewhatishappening here! The alcomb of Mount Everest is excellent! the aforementioned place is amazing! #Wow")
x<- gsub("\\<[a-z]\\{4,10\\}\\>","",m)
x
我尝试了其他方法,例如
m<- c("Hello! #London is gr8. I really likewhatishappening here! The alcomb of Mount Everest is excellent! the aforementioned place is amazing! #Wow")
x<- gsub("[^(\\b.{4,10}\\b)]","",m)
x
我需要删除长度小于 4 或大于 10 的单词。我哪里错了?
【问题讨论】: