R/fisherCorrect.R

Defines functions fisherCorrection

fisherCorrection = function(fc){
   #Adding a tiny value to zero/Inf odds ratios (zeros become Inf's when log converted)
  fc = as.data.frame(fc)
  fc$or = ifelse(test = is.infinite(fc$or), yes = fc$ci.up, no = fc$or )
  fc$or = ifelse(test = fc$or == 0, yes = fc$ci.low, no = fc$or)

  fc$ci.low = ifelse(test = fc$ci.low == 0, yes = fc$or, no = fc$ci.low)
  fc$ci.up = ifelse(test = is.infinite(fc$ci.up), yes = fc$ci.low, no = fc$ci.up)

  return(data.table::data.table(fc))

}

Try the maftools package in your browser

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

maftools documentation built on Feb. 6, 2021, 2 a.m.