R/hlog.R

Defines functions hlog

Documented in hlog

   
hlog <- function(x,constant=1){ #constant is where the change occurs
  if(constant<=0){
    warning("constant less than or equal to 0. Returning log(x)\n")
    return(log(x))
  }
  else{
    if(constant==Inf)
      return(x)
    else{
      aux <- (abs(x)<constant)*(x) +
        (abs(x)>=constant)*(sign(x)*(constant*log(abs(x/constant))+constant))
      aux[x==0] <- 0
      return(aux)
    }
  }
}

Try the affy package in your browser

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

affy documentation built on Nov. 8, 2020, 8:18 p.m.