[adegenet-forum] Cross validation using xvalDapc
kirsty.m.medcalf at gmail.com
Tue Sep 29 18:44:08 CEST 2015
I am attempting to cross validate my results from DAPC analysis with a 70 %
training set using the function xvalDapc (code below). My data frame is
called LDA.scores. this is an updated version of a previous post after
taking into account the recommendationsbut I am still outputting the same
error message. Do I have to change my data frame into a list? If so, what
would be the correct format to transform the data frame into this format.
If this is possible, I was wondering if anyone had a solution with how to
solve this error message (below). I have looked online and through
available tutorials and still cannot solve this issue. Words cannot
describe my gratitude if this is possible.
#Permute the data
contrib <- loadingplot(dapc1$var.contr, axis=2,
x1 <- LDA.scores
xval <- xvalDapc(x1, grp1, n.pca.max = 2, training.set = 0.7,
result = "groupMean", center = TRUE, scale = FALSE,
n.pca = NULL, n.rep = 30, xval.plot = TRUE)
Error in sort.list(y) : 'x' must be atomic for 'sort.list'
Have you called 'sort' on a list?
During the DAPC analysis, I chose to retain 2 PCs and 2 LD's, and there
appears to be 3 clusters. Would n.pca.max=2 be correct?
My reproducible data, the logical steps that I took to chose the number of
PC's and LD's to retain, and the number of chosen clusters is available on
If it is possible to help me, then thank you
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the adegenet-forum