R/measure_missing.R

Defines functions measure.missing

Documented in measure.missing

#' Measure the missingness of a SNP or entry
#'
#'
measure.missing <- function(x, type = "numeric") {

  if (type == "numeric") {
    return( sum(is.na(x)) / length(x) )
  }

  if (type == "nucleotide") {
    return( sum(x == "NN") / length(x) )
  }
}
neyhartj/gws documentation built on Feb. 5, 2024, 12:42 a.m.