Removing rows with * prefixed string

前端 未结 5 1957
故里飘歌
故里飘歌 2021-01-27 06:22

I have a data frame which is as given below

85  P   74  P   70  P   35  P   38  P   54
49  P   35  P   30  P   50  P   30  P   30
104 P   69  P   50  P   70  P           


        
5条回答
  •  青春惊慌失措
    2021-01-27 06:44

    paste the rows together, grepl the ones with stars and take those not matched:

    DF[!grepl("*", do.call(paste, DF), fixed = TRUE), ]
    

    giving:

       V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11
    1  85  P 74  P 70  P 35  P 38   P  54
    2  49  P 35  P 30  P 50  P 30   P  30
    3 104  P 69  P 50  P 70  P 70   P  87
    6  76  P 86  P 69  P 84  P 66   P  79
    7 110  P 65  P 40  P 57  P 57   P  74
    

提交回复
热议问题