Nothing
# Roulette wheel selection 2
selrws2 = function(fitvals, ns, ...){
n = length(fitvals) # Population size
if(missing(ns)) ns=n
p = fitvals/sum(fitvals)
q = cumsum(p) # Cumulative probabilities
matpool = rep(NA, ns) # Mating pool
for(i in 1:ns){
r = runif(1, 0, 1)
matpool[i] = which(q >= r)[1]
}
return(matpool)
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.