R/check_zeros.R

Defines functions check_zeros

Documented in check_zeros

check_zeros <- function(samples, val) {
  # browser()
  samples <- rowid_to_column(samples)
  bad <- slice(samples, which(rowSums(samples == 0) > 1))
  if (nrow(bad) == 0) return(select(samples, -rowid))
  else {
    good <- setdiff(samples, bad)
    adj_bad <- as_tibble(val * (bad == 0) + bad)
    union(good, adj_bad) %>%
      arrange(rowid) %>%
      select(-rowid)
  }
}
BriceonWiley/IntegratedLikelihood.R documentation built on Aug. 21, 2020, 11 p.m.