<div dir="ltr"><div><div><div><div><div></div>Hello,<br><br></div>I am trying to use the new xvalDapc function to determine the ideal number of PCs to retain in my DAPC analysis, but am having trouble getting it to work. Here's the code I'm inputting:<br>
<br>xval <- xvalDapc(JRD1NoNa@tab, pop(JRD1), n.pca.max=150, n.da=NULL, n.pca=NULL, center=TRUE, scale=FALSE, n.rep=10)<br><br></div>And this is the error message I receive:<br><br>Error in ldaX$scaling[, 1:n.da, drop = FALSE] : subscript out of bounds<br>
<br><br></div>I've searched around for similar problems, but haven't found anything relating specifically to the lda function in MASS. I'm wondering if it might just be a problem with MASS being out of date with the new version of R/adegenet?<br>
<br></div>Any help would be appreciated, and please let me know if I could include anything else to help identify the problem (my R expertise is pretty minimal). Also, if anyone has any insight/opinions on alternate ways to determine the ideal number of PCs to retain in a DAPC (e.g. the optim.a.score function), I would be interesetd to hear them.<br>
<br>Thanks in advance,<br><br>Julian Dupuis<br><div><div><div><div><br clear="all"><div><div><br>-- <br>Julian Rowe Dupuis<br>Ph.D. Candidate<br>Dept of Biological Sciences<br>CW405, Biol. Sci. Centre<br>University of Alberta<br>
Edmonton, Alberta, CAN<br>T6G 2E9<br>Office: Earth Sciences 1-52A<br>
</div></div></div></div></div></div></div>