RStudio Binomial Test providing strange results I am running a series of binomial tests for different trials. I ran 319 trials, and no matter the number of successes, my p-value is still < 2.2e-16. This includes when my trial had 0 successes.
binom.test(0, 319, p=0.5, alternative = c ("two.sided"), conf.level = 0.95)

the results come out as...
Exact binomial test

data:  0 and 319
number of successes = 0, number of trials = 319, p-value < 2.2e-16
alternative hypothesis: true probability of success is not equal to 0.5
95 percent confidence interval:
 0.00000000 0.01149728
sample estimates:
probability of success 
                     0 

A successful trial has the same p-value...
Exact binomial test

data:  21 and 319
number of successes = 21, number of trials = 319, p-value < 2.2e-16
alternative hypothesis: true probability of success is not equal to 0.5
95 percent confidence interval:
 0.04120874 0.09887112
sample estimates:
probability of success 
            0.06583072 

Am I interpreting the results wrong? Please help!

The 319 trial binomial test is coming back close to zero as there's very little chance of getting that outcome. Probably what you really want is to test for that number of successes or more. Here's how to construct a table of probabilities for 100 tests, just change the 100 to 319 or whatever number is required. The table will include left tails, right tails, equal, and not equal, so just select as desired.
library(data.table)
DT=data.table(cbind(Heads=seq(100,0,by=-1), Tails=seq(0,100,by=1)))
DT[, BinomL := pbinom(Heads-1, Heads+Tails, 0.5), keyby=Heads]
DT[, BinomR := pbinom(Heads, Heads+Tails, 0.5, lower.tail=FALSE)]
DT[, BinomEQ := pbinom(Heads-1, Heads+Tails, 0.5, lower.tail=FALSE) - pbinom(Heads, Heads+Tails, 0.5, lower.tail=FALSE)]
DT[, BinomLR := BinomL + BinomR]
DT[, BinomTot := BinomL + BinomR + BinomEQ]
View(DT)

The C code underlying R binom/pbinom/etc. uses algorithm 708, so in theory you should have plenty of digits of precision.
