x <- rnorm(1e6, qnorm(0.05, lower.tail = TRUE))
pvalue(x) # should be 0.05 * 2
pvalue(x, side = "left") # should be 0.95
pvalue(x, side = "right") # should be 0.05
pvalue(rep(1, 10)) # skeptical = TRUE (default) avoids p = 0
pvalue(rep(1, 10), skeptical = FALSE) # skeptical = FALSE allows p = 0
Run the code above in your browser using DataLab