<div dir="ltr">Dear all<br><br><div class="gmail-post-text">

<p>I want to perform a PCA analysis in adegenet starting from a genepop file without defined populations.
I imported the data like this:
datapop <- read.genepop('tous.gen', ncode=3, quiet = FALSE)</p>

<p>it works, and I can perform a PCA after scaling the data.
But I would like to plot the results / individuals on the PCA axis 
according to their population of origin using s.class. I have a vcf file
 with a three lettre code for each individual. I imported it in R:
pops_list <- read.csv('liste_pops.csv', header=FALSE)</p>

<p>but now how can I use it to define population levels in the genind object 'datapop'?
I tried something likes this:
setPop(datapop, formula = NULL)</p>

<p>setPop(datapop) <- pops_list
but it doesn't work; even the first line doesn't work: I get this message: "Erreur : formula must be a valid formula object."</p>

<p>And then how should I use it in s.class? <br></p><p>thanks</p><p>Didier</p>
    </div>
    
        </div>