[adegenet-forum] customize labels within centroid
Jombart, Thibaut
t.jombart at imperial.ac.uk
Tue Nov 13 11:28:55 CET 2012
Hello,
Just to clarify, R uses no 'file' for storing objects during a session, everything is stored in the RAM.
The rule in R is to type the name of an object to print its content. You can use '@' or '$' to access the content of genind objects.
In your case, you're looking for:
##
H3N2 at other$epid
##
which is simply a vector of numeric. You can pass any vector of character, numeric, or factor to 'pop' to change the population information of a genind. The only requirement is for this vector to have a length which is the number of individuals in the study.
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 J. Richardson [jrichardson4 at gmail.com]
Sent: 12 November 2012 21:05
To: adegenet-forum at lists.r-forge.r-project.org
Subject: [adegenet-forum] customize labels within centroid
Hi Thibaut and Adegenet users,
I have what I think is a simple/quick question, but have not been able to figure out on my own or via the archives. I have a dataset (Genepop formatted) I have been working with to conduct DAPC and create a scatterplot. I have a legend with each population/sampling site name listed (there are 13), which roughly corresponds to the population/site names within the Genepop file (between each "POP" line). I would like to include these same labels within each of the 13 centroids on the scatterplot, but currently when I set "clab=1" the labels are displayed "P01", "P02"... "P13" rather than the names of the populations/sites in the data file or the object created to put this names in the legend.
Do you know how I can change these labels, either manually with a new object for the "clab=" command to use, or for "scatter" to refer to in the Genepop input file? I see in the H3N2 example, that the labels were amended to the epidemic years - I think using the "pop(H3N2) <- H3N2$other$epid" line. But I can't figure out how to display the H3N2 data to see how the "epid" item is incorporated into the file.
Thank you in advance for any advice or insights.
Jonathan
More information about the adegenet-forum
mailing list