Using regexp to select rows in R dataframe

前端 未结 7 1087
终归单人心
终归单人心 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:52

    Corrected according Andrie advice. I hope this should work. :)

    df[grepl("ADN", df$bName),]
    df[grepl("ADN", df$bName) & df$pName == "2011-02-10_R2",]
    
    0 讨论(0)
提交回复
热议问题