R/randmut.R

Defines functions randmut

Documented in randmut

# random replacement mutation
randmut = function(y, lb, ub, ...){
  m = length(y)
  if(missing(lb) | missing(ub)) 
    stop("randmut requires lb and ub!")
  j = sample(1:m, 1)
  y[j] = runif(1, lb[j], ub[j])
  return(list(mutant=y, mutgen=j))
}

Try the adana package in your browser

Any scripts or data that you put into this service are public.

adana documentation built on March 18, 2022, 6:03 p.m.