# create a data set (typically done by reading files)
mygenotypes <- array(list(-9), dim = c(6,2), dimnames =
list(paste("ind",1:6, sep=""),c("loc1","loc2")))
mygenotypes[,"loc1"] <- list(c(206), c(208,210), c(204,206,210),
c(196,198,202,208), c(196,200), c(198,200,202,204))
mygenotypes[,"loc2"] <- list(c(130,134), c(138,140), c(130,136,140),
c(138), c(136,140), c(130,132,136))
mypopinfo <- c(1,1,1,2,2,2)
names(mypopinfo) <- dimnames(mygenotypes)[[1]]
myploidies <- c(2,2,4,4,2,4)
names(myploidies) <- dimnames(mygenotypes)[[1]]
# calculate allele frequencies
myfreq <- estimate.freq(mygenotypes, popinfo = mypopinfo,
indploidies = myploidies)
# calculate pairwise FST
myfst <- calcFst(myfreq)
# examine the results
myfst
Run the code above in your browser using DataLab