thibautjombart / adegenet

adegenet: a R package for the multivariate analysis of genetic markers
165 stars 64 forks source link

xval error object 'out' not found #330

Closed nlv209 closed 2 years ago

nlv209 commented 2 years ago

Hi, I have run xval successfully many times with microsat data and am now encountering an error I cannot figure out when using radseq data (6251 loci, 242 individs)

Here is the code I am trying to run and the error that pops up with xval:

data <- import2genind("test.stru", n.ind=242, n.loc=6251,onerowperin=FALSE, col.lab=1, col.pop=2,row.marknames=1) data_scaled <- tab(data,NA.method="mean") grp<-find.clusters(data_scaled, max.n.clust=40) xval<-xvalDapc(data_scaled, grp$grp, n.pca.max=200, training.set=0.9, result = "GroupMean", center=TRUE, scale=FALSE, n.pca=NULL, n.rep=10, xval.plot=TRUE) Error in statistic(dd, ...) : object 'out' not found

Any ideas about what is causing this error are greatly appreciated! Nikki

zkamvar commented 2 years ago

Hello, you need to specify "groupMean" with a lower-case "g", not "GroupMean":

https://github.com/thibautjombart/adegenet/blob/ca376afaccd4617e73ac65212c23a224fc601bd3/R/xvalDapc.R#L68