## Lay table out as a 3D array, as in Fisher (1936)
abc <- aperm(array(mendelABC[,4], dim=c(3,3,3),
dimnames=c("B","C","A")),
c(1,3,2))
dimnames(abc) <- list(B=c('BB','Bb','bb'),
A=c('AA','Aa','aa'),
C=c('CC','Cc','cc'))
abc
## Fit Hardy-Weinberg disequilibium model
hwde(mendelABC, loci=c("seedshape","cotylcolor","coatcolor"))Run the code above in your browser using DataLab