希望这能很好地满足你。 我需要在文本中的任何位置找到那些包含术语
info
的行
这是可以提供帮助的数据快照
df_new <- data.frame(
text=c('info is given','he is given info. in the class',
'she needs info2','why not having information',
'his info# missing', 'info12 and packages are given',
'parainfo is ready','info. was awarded',
'meeting is with .info'))
> df_new
text
1 info is given
2 he is given info. in the class
3 she needs info2
4 why not having information
5 his info# missing
6 info12 and packages are given
7 parainfo is ready
8 info. was awarded
9 meeting is with .info
因此,感兴趣的结果是:
text strings_detected
info is given 1
he is given info. in the class 1
she needs info2 1
why not having information 0
his info# missing 1
info12 and packages are given 1
parainfo is ready 0
info. was awarded 1
meeting is with .info 0
非常感谢!