R/perturbWeights.R

# add perturbations to weights, without changing the sort order of nonunique 
# elements
#
#
perturbWeights <- function(x){
    d <- diff(sort(x))
    p <- min(x, d[d > 0]) / 100
    x + runif(length(x), max=p)
}

Try the editrules package in your browser

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

editrules documentation built on May 1, 2019, 6:32 p.m.