## The function is currently defined as
function(dist.val, random.vals) {
return((sum(random.vals <= dist.val) + 1) /(length(random.vals) + 1))
}
## Define the similarity value and a vector of random similarities
sim.val <- 0.2
rand.vals <- c(0.1, 0.24, 0.28, 0.35, 0.15, 0.5, 0.14, 0.6, 0.8, 0.3)
## Calculate the p-value of sim.val using the vector of random
## similarities
Pval.dist(dist.val = sim.val, random.vals = rand.vals)
Run the code above in your browser using DataLab