R/HWChisqMat.R

Defines functions HWChisqMat

Documented in HWChisqMat

HWChisqMat <- function(X,...) {
# applys chi-square test for HWE to all rows of X.
pvalvec <- NULL
chisqvec <- NULL
Dvec <- NULL
for (i in 1:nrow(X)) {
   out <- HWChisq(X[i,],...)
   pvalvec <- c(pvalvec,out$pval)
   chisqvec <- c(chisqvec,out$chisq)
   Dvec <- c(Dvec,out$D)   
}
return(list(pvalvec=pvalvec,chisqvec=chisqvec,Dvec=Dvec))
}

Try the HardyWeinberg package in your browser

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

HardyWeinberg documentation built on May 7, 2022, 5:05 p.m.