m <- 9:12; n <- 7:10; k <- 10
x <- 0:(k+1) # length 12
for(. in 0:11) stopifnot(
all.equal(phyper (., m=10, n=8, k=10),
phyperR(., m=10, n=8, k=10), tol=1e-12))
## BUT the vectorization fails badly : FIXME! %% <<<<<< FIXME <<<<<<<<<<<<<<<
(A <- cbind(x, m, n, k)) # shows the recycling
cbind(A, ph = phyper (x, m, n, k),
phR = phyperR(x, m, n, k))
Run the code above in your browser using DataLab