haplo <- rbind(
c( 1, 2, 2, 1, 2),
c( 1, 2, 2, 1, 1),
c( 1, 1, 2, 1, 1),
c( 1, 2, 1, 1, 2),
c( 1, 2, 2, 2, 1),
c( 1, 2, 1, 1, 1),
c( 1, 1, 2, 2, 1),
c( 1, 1, 1, 1, 2),
c( 1, 2, 1, 2, 1),
c( 1, 1, 1, 2, 1),
c( 2, 2, 1, 1, 2),
c( 1, 1, 2, 1, 2),
c( 1, 1, 2, 2, 2),
c( 1, 2, 2, 2, 2),
c( 2, 2, 2, 1, 2),
c( 1, 1, 1, 1, 1),
c( 2, 1, 1, 1, 1),
c( 2, 1, 2, 1, 1),
c( 2, 2, 1, 1, 1),
c( 2, 2, 1, 2, 1),
c( 2, 2, 2, 1, 1))
dimnames(haplo)[[2]] <- paste("loc", 1:ncol(haplo), sep=".")
haplo <- data.frame(haplo)
haplo.freq <- c(0.170020121, 0.162977867, 0.123742455, 0.117706237, 0.097585513, 0.084507042,
0.045271630, 0.039235412, 0.032193159, 0.019114688, 0.019114688, 0.013078471,
0.013078471, 0.013078471, 0.013078471, 0.006036217, 0.006036217, 0.006036217,
0.006036217, 0.006036217, 0.006036217)
hPair <- get.hapPair(haplo, haplo.freq, base.index=1)
names(hPair)
dim(hPair$x.haplo)
Run the code above in your browser using DataLab