R/gl.He.r

Defines functions gl.He

Documented in gl.He

#' Estimates expected Heterozygosity
#'
#' @param gl A genlight object [required]
#' @return A simple vector whit Ho for each loci
#' @export
#' @author Bernd Gruber (Post to \url{https://groups.google.com/d/forum/dartr})

gl.He <- function(gl) {
  alf <- colMeans(as.matrix(gl), na.rm = T) / 2
  out <- alf * (1 - alf) * 2
  return(out)
}

Try the dartR package in your browser

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

dartR documentation built on June 8, 2023, 6:48 a.m.