R/perturbWeights.R

Defines functions perturbWeights

# 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 June 22, 2024, 12:21 p.m.