Hello,
While I was following this sPCA tutorial, I found that the multivariate tests to detect local structuring (local.rtest) does not seem to work properly in the adespatial package. However, it works fine in the adegenet package.
library(adegenet) ; library(adespatial)
data(spcaIllus)
obj <- spcaIllus$dat4
mySpca <- spca(obj,type=1,scannf=FALSE,plot.nb=FALSE,nfposi=1,nfnega=0)
myGtest <- adegenet::global.rtest(obj$tab,mySpca$lw,nperm=99) ; myGtest # Works just fine
myGtest <- adespatial::global.rtest(obj$tab,mySpca$lw,nperm=99) ; myGtest # Works just fine
myLtest <- adegenet::local.rtest(X = obj$tab, listw = mySpca$lw, nperm = 99) ; myLtest # Works just fine
myLtest <- adespatial::local.rtest(X = obj$tab, listw = mySpca$lw, nperm = 99) ; myLtest # Observation: NA -> not working
I tried to understand why, and the only difference between adegenet:::local.rtest and adespatial:::local.rtest is the call to the orthobasis.listw function.
Hello, While I was following this sPCA tutorial, I found that the multivariate tests to detect local structuring (
local.rtest
) does not seem to work properly in the adespatial package. However, it works fine in the adegenet package.I tried to understand why, and the only difference between
adegenet:::local.rtest
andadespatial:::local.rtest
is the call to the orthobasis.listw function.adegenet:::local.rtest
callsadegenet:::.orthobasis.listw
adespatial:::local.rtest
callsadespatial:::orthobasis.listw
The issue could be problematic since using local.rtest without precision on the package calls the adespatial::local.rtest which doesn't work properly.