options(digits=4)
data(tetragonula)
tnb <-
coord2dist(coordmatrix=tetragonula.coord[83:120,],cut=50,
file.format="decimal2",neighbors=TRUE)
ta <- alleleconvert(strmatrix=tetragonula[83:120,])
tai <- alleleinit(allelematrix=ta,neighborhood=tnb$nblist)
tetraspec <- c(rep(1,11),rep(2,13),rep(3,14))
tetracoms <-
c(rep(1:3,each=3),4,5,rep(6:11,each=2),12,rep(13:19,each=2))
c1 <- communitydist(tai,comvector=tetracoms,distance="chord",
geodist=tnb$distmatrix,grouping=tetraspec)
c2 <- communitydist(tai,comvector=tetracoms,distance="phipt",
geodist=tnb$distmatrix,grouping=tetraspec,compute.geodist=FALSE)
c3 <- communitydist(tai,comvector=tetracoms,distance="shared.average",
geodist=tnb$distmatrix,grouping=tetraspec,compute.geodist=FALSE)
c4 <- communitydist(tai,comvector=tetracoms,distance="shared.chakraborty",
geodist=tnb$distmatrix,grouping=tetraspec,compute.geodist=FALSE)
c5 <- communitydist(tai,comvector=tetracoms,distance="shared.problist",
geodist=tnb$distmatrix,grouping=tetraspec,compute.geodist=FALSE)
round(c1$cgeodist,digits=1)
c1$comvector
c2$comvector
c3$comvector
c4$comvector
c5$comvector
round(c1$dist,digits=2)
round(c2$dist,digits=2)
round(c3$dist,digits=2)
round(c4$dist,digits=2)
round(c5$dist,digits=2)
Run the code above in your browser using DataLab