fdrThres <- function (pval, fdr = 0.05) {
require(dplyr)
n <- pval %>% length
comp <- (pval %>% sort) < ((fdr/n) * (1:n))
if (min(pval) < (fdr/n)) {
w1 <- which(!comp)[1]
return((fdr/n) * w1)
}
else {
return(fdr/n)
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.