Using regexp to select rows in R dataframe

前端 未结 7 1107
终归单人心
终归单人心 2020-12-08 00:48

I\'m trying to select rows in a dataframe where the string contained in a column matches either a regular expression or a substring:

dataframe:

7条回答
  •  南方客
    南方客 (楼主)
    2020-12-08 01:45

    Why not just:

    grep 'ADN'|grep '2011-02-10_R2'
    

    You could also do this:

    grep -P '\t.{4}(ADN).*(2011-02-10_R2).*'
    

提交回复
热议问题