[adegenet-forum] assigning pop in genind object

Jombart, Thibaut t.jombart at imperial.ac.uk
Fri Feb 8 14:58:43 CET 2013


Hello, 

please have a look at the documentation, especially the vignette on basics (vignette("adegenet-basics")). 

You want to use :
pop(hj) <- ...

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 takele taye [takele_taye at yahoo.com]
Sent: 08 February 2013 12:49
To: adegenet-forum at lists.r-forge.r-project.org
Subject: [adegenet-forum] assigning pop in genind object

Dears

I converted my hj.str data into genind object using the read.structure function.
hj<- read.structure(file="hj.str", n.ind=747, n.loc=168344,  onerowperind=TRUE, col.lab=1, col.pop=2, NA.char=-9, ask=FALSE)

My data contains two populations (represented by 1 & 2 in pop column of the hj.str data), the data was not sorted by population. How can I define the population of each individual in the genind object hj at pop.

I tried this one
pop_1 <- hj at pop==1
pop_2 <- hj at pop==2

However, this has clumped the entire population just into two dots instead of representing each individual in the PCA plot.

Any help is appreciated

Takele



More information about the adegenet-forum mailing list