data(testdata)
g <- Autosomes[1:10, 20] ## A vector of codes
p <- g2post(g) ## Transform to probabilities ...
pg <- post2g(p) ## ... and back to codes
m <- p[,2]+2*p[,3] ## Posterior expectations
mg <- mean2g(m) ## Transform to codes ...
pmg <- g2post(mg) ## ... and transform to probabilities
## Write everything out
print(cbind(as(g, "numeric"), p, as.numeric(pg), m, as.numeric(mg), pmg))
Run the code above in your browser using DataLab