[adegenet-forum] problems adding predicted points to scatter plot

Jombart, Thibaut t.jombart at imperial.ac.uk
Tue Nov 4 15:12:58 CET 2014


Hi there,

for this it is best to re-use the example in the DAPC tutorial, p. 40, though I suspect this is what you have done already.

I'd need to play with a reproducible example, but I think the problem comes from using add.scatter.eig, implicitly called when you ask for either screeplot to be added in scatter.dapc. This changes the coordinate system. Best think to do is disable these, add the new points, then add the screeplot last, as in the example.

Cheers
Thibaut

________________________________
From: adegenet-forum-bounces at lists.r-forge.r-project.org [adegenet-forum-bounces at lists.r-forge.r-project.org] on behalf of Andres Schjønhaug Susrud [andres.susrud at gmail.com]
Sent: 30 October 2014 20:02
To: adegenet-forum at lists.r-forge.r-project.org
Subject: [adegenet-forum] problems adding predicted points to scatter plot

Dear list,

I'm having problems adding points to a dapc scatter plot.

grp = find.clusters(human_DR_bind_2[1:200,])
dapc1 <- dapc(human_DR_bind_2[1:200,],grp$grp)
pred.sup <- predict.dapc(dapc1, newdata=x.sup2)
names(pred.sup)
scatter(dapc1, cell=2.5, pch=1, cstar=0, axesel=FALSE, col=c(2,3,4))
par(xpd=T)
points(pred.sup$ind.scores[,1],pred.sup$ind.scores[,2],pch = 2,col = 6)

the problem is that the predicted points are "all" visible, but completely out of placement.

when plotting the dapc1$ind.scores[,1],dapc1$ind.scores

plot(dapc1$ind.scores[,1],dapc1$ind.scores)
points(pred.sup$ind.scores[,1],pred.sup$ind.scores[,2],pch = 2,col = 6)


the alligment seems fine.

thanks for any help on this matter

BR

Andres
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20141104/695b3681/attachment-0001.html>


More information about the adegenet-forum mailing list