R/autoThreshold.R

"autoThreshold" <-
function(d.m, est=0.5) {
  est.old <- 0
  while (est.old != est) {
    est.old <- est
    t1 <- mean(d.m[d.m < est], na.rm=TRUE)
    t2 <- mean(d.m[d.m > est], na.rm=TRUE)
    est <- mean(c(t1, t2), na.rm=TRUE)
  }
  return(c(t1, mean(c(t1, est)), est, mean(c(t2,est)), t2))
}

Try the rtiff package in your browser

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

rtiff documentation built on Jan. 14, 2021, 5:20 a.m.