R/check.R

check <- modules::module({

  samplingVar <- function(samplingVar) {

    anyNa <- any(is.na(samplingVar))

    if (anyNa) stop("Missing values in sampling variances are not allowed.")

    anyZero <- any(samplingVar <= 0)

    if (anyZero) {
      warning("There are zero sampling variances. They are replaced by 1e-05.")
      samplingVar <- replace(samplingVar, samplingVar == 0, 1e-05)
    }

    samplingVar
    
  }
  
})

Try the saeRobust package in your browser

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

saeRobust documentation built on May 2, 2019, 7:29 a.m.