Last chance! 50% off unlimited learning
Sale ends in
gstat.randtest
implements Goudet's
G-statistic Monte Carlo test (g.stats.glob
, package
hierfstat
) for genind
object.
The output is an object of the class randtest
(package
ade4
) from a genind
object.
This procedure tests for genetic structuring of individuals using 3 different
schemes (see details).gstat.randtest(x,pop=NULL, method=c("global","within","between"),
sup.pop=NULL, sub.pop=NULL, nsim=499)
genind
.randtest
(package ade4
).g.stats.glob
,
fstat
,
test.g
,test.within
,
test.between
,as.randtest
,
genind2hierfstat
if(require(hierfstat)){
# here the example of g.stats.glob is taken using gstat.randtest
data(gtrunchier)
x <- df2genind(X=gtrunchier[,-c(1,2)],pop=gtrunchier$Patch)
# test in hierfstat
gtr.test<- g.stats.glob(gtrunchier[,-1])
gtr.test
# randtest version
x.gtest <- gstat.randtest(x,nsim=99)
x.gtest
plot(x.gtest)
# pop within sup.pop test
gstat.randtest(x,nsim=99,method="within",sup.pop=gtrunchier$Locality)
# pop test with sub.pop kept constant
gstat.randtest(x,nsim=99,pop=gtrunchier$Locality,method="between",sub.pop=gtrunchier$Patch)
}
Run the code above in your browser using DataLab