Filter data.frame rows by a logical condition

前端 未结 9 1591
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-21 05:43

I want to filter rows from a data.frame based on a logical condition. Let\'s suppose that I have data frame like

   expr_value     cell_type
1           


        
9条回答
  •  庸人自扰
    2020-11-21 05:54

    You could use the dplyr package:

    library(dplyr)
    filter(expr, cell_type == "hesc")
    filter(expr, cell_type == "hesc" | cell_type == "bj fibroblast")
    

提交回复
热议问题