<div dir="ltr">Hi <div><br></div><div>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. If this is possible, I was wondering if anyone had a solution to this error message (below). I have looked online and through available tutorials and still cannot </div><div>solve this issue.</div><div><br></div><div><div>Error in sort.list(y) : 'x' must be atomic for 'sort.list'<br></div><div>Have you called 'sort' on a list?</div></div><div><br></div><div> Also, I have confusion regarding the argument n.pca.max. My data frame has two grouping dependent factors, 12 predictor values and 80 observations. Would n.pca.max=80 be correct? <br></div><div><br></div><div>If it is possible to help me, then thank you</div><div><br></div><div>Best wishes,</div><div>Kirsty</div><div><br></div><div>CODE</div><div><br></div><div>#Permute the data<br></div><div>set.seed(999) </div><div><br></div><div>#DAPC analysis</div><div><br></div><div><div>windows(width=10, height=7)</div><div>x<-LDA.scores[,2:13]</div><div>grp1<-find.clusters(x, max.n.clust=12)</div><div>dapc1<-dapc(x, grp1$grp)</div><div>dapc1</div><div><br></div><div>windows(width=10, height=7)<br></div></div><div><div><div><div><div>x1 <- LDA.scores</div><div>mat <- as.matrix(x1, method="mean")</div><div>grp2 <- x1</div><div>xval <- xvalDapc(mat, grp2, n.pca.max = 80, training.set = 0.7,</div><div> result = "groupMean", center = TRUE, scale = FALSE,</div><div> n.pca = NULL, n.rep = 30, xval.plot = TRUE)</div></div><div><br></div><div><br></div><div><div>Error in sort.list(y) : 'x' must be atomic for 'sort.list'</div><div>Have you called 'sort' on a list?</div></div><div><br></div><div><br></div><div>Kirsty Medcalf</div><div> </div><div><a href="mailto:kirsty.m.medcalf@gmail.com" target="_blank">kirsty.m.medcalf@gmail.com</a></div><div> </div><div><a href="tel:%2B447963374030" value="+447963374030" target="_blank">+447963374030</a></div><div> </div><div>skype contact: kirsty.medcalf</div></div></div>
</div></div>