
R version 2.11.1 Patched (2010-09-30 r53083)
Copyright (C) 2010 The R Foundation for Statistical Computing
ISBN 3-900051-07-0

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> ## nested use of BTm
> ## (in response to Jing Hua Zhao's bug report)
> library(BradleyTerry2)
> myfun <- function(x) {
+     c2b <- countsToBinomial(x)
+     names(c2b) <- c("allele1", "allele2", "transmitted", "nontransmitted")
+     btx <- BTm(cbind(transmitted, nontransmitted), allele1, allele2,
+                ~allele, id = "allele", data = c2b)
+ }
> 
> x <- matrix(c(0,0, 0, 2, 0,0, 0, 0, 0, 0, 0, 0,
+               0,0, 1, 3, 0,0, 0, 2, 3, 0, 0, 0,
+               2,3,26,35, 7,0, 2,10,11, 3, 4, 1,
+               2,3,22,26, 6,2, 4, 4,10, 2, 2, 0,
+               0,1, 7,10, 2,0, 0, 2, 2, 1, 1, 0,
+               0,0, 1, 4, 0,1, 0, 1, 0, 0, 0, 0,
+               0,2, 5, 4, 1,1, 0, 0, 0, 2, 0, 0,
+               0,0, 2, 6, 1,0, 2, 0, 2, 0, 0, 0,
+               0,3, 6,19, 6,0, 0, 2, 5, 3, 0, 0,
+               0,0, 3, 1, 1,0, 0, 0, 1, 0, 0, 0,
+               0,0, 0, 2, 0,0, 0, 0, 0, 0, 0, 0,
+               0,0, 1, 0, 0,0, 0, 0, 0, 0, 0, 0),nrow=12)
> colnames(x) <- 1:12
> rownames(x) <- 1:12
> 
> xx <- myfun(x)
> 
