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
No one seems to have included the which function. It can also prove useful for filtering.
expr[which(expr$cell == 'hesc'),]
This will also handle NAs and drop them from the resulting dataframe.
Running this on a 9840 by 24 dataframe 50000 times, it seems like the which method has a 60% faster run time than the %in% method.