R/fixlimits.R

Defines functions fixlimits

Documented in fixlimits

fixlimits <- function(x) {
    a <- min(x[x>0 & x<1], na.rm = T)
    b <- max(x[x>0 & x<1], na.rm = T)
    x[x<=0] <- a*.5
    x[x>=1] <- (1+b)*.5
    return(x)
}

Try the preputils package in your browser

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

preputils documentation built on July 1, 2020, 5:35 p.m.