How to extract specific rows depending on part of the strings in one column in R

前端 未结 1 554
野的像风
野的像风 2021-01-26 07:45

When I use R, I try to extract specific rows which have some specific strings in one column. The data structure as following

ERC1    20679  14959  9770  RAB6-int         


        
相关标签:
1条回答
  • 2021-01-26 08:37

    Assuming that your data frame is df:

    df[grep("^RAB6", df$column),]
    

    If not all values start with RAB6 remove the^.

    0 讨论(0)
提交回复
热议问题