[adegenet-forum] DAPC and coordinates
Jombart, Thibaut
t.jombart at imperial.ac.uk
Fri Dec 3 23:07:36 CET 2010
Hi Bernhard,
what are the error messages you received? To try and find the problem, you can try to plot the spatial coordinates separately to make sure everything's OK. For instance:
plot(xy)
Also compare the dimensions of the two objects:
dim(xy)
dim(dapc1$grp.coord)
If the number of rows differ, this is a problem. I will be travelling the next week, so sorry if I don't reply soon.
Best
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 Bernhard Stoeckle (Wildbiologie) [stoeckle at wzw.tum.de]
Sent: 02 December 2010 08:49
To: adegenet-forum at r-forge.wu-wien.ac.at
Subject: [adegenet-forum] DAPC and coordinates
Dear Thibaut,
thank you very much for your last answer. It worked perfect! I am really sorry
but I have one last question and I would be glad if you can help me again.
I have a microsatellite data set (8 populations and 12 loci) with geographical coordinates and I made a
dapc and it worked well. Then I tried to visualize the dapc in combination with the
geographical coordinates and it failed. I did the following:
I loaded also the package "maps" and I created a textfile named popInfo and it
looked like this:
Population,Longitude,Latitude
1,48.150341,11.881521
2,48.149266,11.887157
3,48.147861,11.874697
4,48.143326,11.973001
5,48.147606,11.899779
6,48.101255,11.870512
7,48.162266,11.970248
8,48.127254,11.915180
Then I tried to visualize the dapc results according
to the example eHDGP in the manual with the following commands:
> xy <- cbind(grp$other$popInfo$Longitude, grp$other$popInfo$Latitude)
> par(mar=rep(.1,4))
> map(fill=TRUE, col="lightgrey")
> colorplot(xy, -dapc1$grp.coord, cex=3, add=TRUE, trans=FALSE)
But it did not work. R showed a couple of error messages.
I would be glad if you can help me again.
Bernhard
Technische Universitaet Muenchen TUM
Lehrstuhl für Zoologie
AG Molekulare Zoologie
Hans-Carl-von-Carlowitz-Platz 2
85354 Freising
More information about the adegenet-forum
mailing list