Edit with example**
gene pvalue log2FoldChange
a 1 -1.5
b 0.01 -2
c 0.004 1.4
I have a dataframe like this ^^
I want to specify a cutoff for pvalue and a range for log2FoldChange outside of which I want the values. So I want ones which have a log2FoldChange >1 or <-1 and a pvalue of <0.05 I've tried:
res <- res[res$padj < 0.05 & res$log2FoldChange > 1 & res$log2FoldChange < -1,]
res <- res[complete.cases(res), ]
But this didn't work! Gave me an empty dataframe called res.