Best Answer · By JanBask Data Science Expert
Answered on Nov 17, 2019

To select rows which contains ‘hesc’, we can do the following
expr[expr$cell_type == "hesc", ]
To select rows having either ‘hesc’ or ‘bj fibroplast’, we can do the following
expr[expr$cell_type %in% c("hesc", "bj fibroblast"), ]
We can also use subset function to choose the rows as
subset(expr, cell_type == "hesc") subset(expr, cell_type %in% c("bj fibroblast", "hesc"))
We can also use filter function from dplyr library as
filter(expr, cell_type %in% c("bj fibroblast", "hesc"))