I have the result of a binomial test and it looks like this:
data: x and n
number of successes = 0, number of trials = 7, p-value = 0.01563
alternative hypothesis: true probability of success is not equal to 0.5
95 percent confidence interval:
0.0000000 0.4096164
sample estimates:
probability of success
0
All I would like to know is how to extract just the p-value in R. I tried grep and pmatch but they appear to require a table or vector.
binom.test(x,n)
. The p-value can be accessed from this output usingbinom.test(x,n)$p.value
.