R/haplofreqs.R

"haplofreqs" <-
function(dat, firstl, lastl){
  n <- nrow(dat)
  hapls <- apply(dat[1:n,firstl:lastl], 1, function(x) paste(x, collapse="")) 
  freqs <- table(hapls)/n  
  return(freqs)
}

Try the hapsim package in your browser

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

hapsim documentation built on May 1, 2019, 9:11 p.m.