# FDR controlling demonstration in R

I'm trying to demonstrate BH method for controlling false discovery rate in R.

The problem is that I get quite unexpected results (so I assume that something is going wrong with this)

set.seed(4)
x = matrix(rnorm(100*5),nrow=100)
set.seed(5)
y = matrix(rnorm(100*5),nrow=100)
set.seed(6)
y[81:100,]= rnorm(100, mean=3)


The p-values are produces from above distributions. (So the first 80 p-values are coming from true null distribution and the rest 20 follow the alternative distribution.)