This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Filter by multiple columns above count threshold in R

So I'm having a brain cramp and I think I'm over thinking it. I'm doing an RNA-seq experiment and want to filter my counts table by if at least four columns have above 20 counts. Any clue how to do this? The function I wrote takes way too long and there has got to be an easier way.

rna-seq workflow

So, what have you tried? It would be more useful for learning process if you show your efforts and thinking process.

1 answer

mycounts[rowSums(mycounts >= 20) >= 4, ]

Log in to answer this question.