<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
got it:
<div class=""><br class="">
</div>
<div class="">
<div class=""># DAPC REGION</div>
<div class=""># change  genind@pop</div>
<div class="">region_pop=read.table("region_pop.txt",head=T)</div>
<div class="">data1585_region <- data1585</div>
<div class="">data1585_region@pop <- as.factor(region_pop[,1])</div>
<div class=""># change <a href="mailto:genind@pop.names" class="">genind@pop.names</a></div>
<div class="">region_pop.names=read.table("region_pop.names.txt",head=T)</div>
<div class="">popnames.region <- as.character(region_pop.names[,1])</div>
<div class="">names(popnames.region) <- paste('P',c(1:6), sep = '')</div>
<div class=""><a href="mailto:data1585_region@pop.names" class="">data1585_region@pop.names</a> <- popnames.region</div>
<div class=""><br class="">
</div>
<div class="">dapc_region <- dapc(data1585_region, grp=data1585@pop, scale=FALSE, n.pca=30, n.da=5)</div>
<div class="">scatter(dapc_region, col=funky(6), clabel=.5,</div>
<div class="">        scree.pca=TRUE, ratio.pca=0.15, </div>
<div class="">        scree.da=TRUE, ratio.da=0.15)</div>
<div class="">mtext("dapc region 1585", side = 3, line = 3)</div>
<div class=""><br class="">
</div>
</div>
<div class="">many thanks to Fred ;-)</div>
<div class=""><br class="">
</div>
<div class="">M.</div>
<div class=""><br class="">
<div apple-content-edited="true" class=""><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px;"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;  ">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class="">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;  ">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class="">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;  "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;  "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica;  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica;  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica;  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class="">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica;  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class="">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica;  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class="">
__________________________________</div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class="">
<font class="Apple-style-span" color="#004D95"> Massimiliano Virgilio, PhD <br class="">
  <br class="">
Royal Museum for Central Africa <br class="">
Leuvensesteenweg 13, B-3080 Tervuren, Belgium, +32 (0) 27695366 <br class="">
  <br class="">
<a href="mailto:massimiliano.virgilio@africamuseum.be" class="">massimiliano.virgilio@africamuseum.be</a> <br class="">
<br class="">
<a href="http://www.africamuseum.be/home/contact/staff/VIRGILIO_Massimiliano/" class="">http://www.africamuseum.be/home/contact/staff/VIRGILIO_Massimiliano/</a></font></div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class="">
<font class="Apple-style-span" color="#2900D2"><br class="">
</font></div>
</span></div>
</span></div>
</span></span></span></span></span></div>
</span><br class="Apple-interchange-newline">
</div>
</span><br class="Apple-interchange-newline">
</span><br class="Apple-interchange-newline">
</div>
<br class="">
<div class="">
<blockquote type="cite" class="">
<div class="">On 18 Nov 2014, at 15:03, Virgilio Massimiliano <<a href="mailto:massimiliano.virgilio@africamuseum.be" class="">massimiliano.virgilio@africamuseum.be</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; font-size: 14px; font-family: Calibri, sans-serif;" class="">
<div class=""><span style="font-family: Helvetica; font-size: 12px;" class="">Dear Thibaud,</span><br style="font-family: Helvetica; font-size: 12px;" class="">
<span style="font-family: Helvetica; font-size: 12px;" class="">I’m trying to group populations of a genind object according to region and country of origin.</span><br style="font-family: Helvetica; font-size: 12px;" class="">
<span style="font-family: Helvetica; font-size: 12px;" class="">The idea was to perform DAPCs and maximise differences between individuals from different regions/countries.</span><br style="font-family: Helvetica; font-size: 12px;" class="">
<br style="font-family: Helvetica; font-size: 12px;" class="">
<span style="font-family: Helvetica; font-size: 12px;" class="">I first added the region/country info to the @other slot of the genind object and then tried to perform DAPC:</span><br style="font-family: Helvetica; font-size: 12px;" class="">
<br style="font-family: Helvetica; font-size: 12px;" class="">
<span style="font-family: Helvetica; font-size: 12px;" class=""><i class="">dapc_region <- dapc(data, grp=data@other$region, scale=FALSE, n.pca=20, n.da=5)</i></span><br style="font-family: Helvetica; font-size: 12px;" class="">
<br style="font-family: Helvetica; font-size: 12px;" class="">
<span style="font-family: Helvetica; font-size: 12px;" class="">yet, all I could get was a DAPC using populations as defined by the @pop slot,</span><br style="font-family: Helvetica; font-size: 12px;" class="">
<br style="font-family: Helvetica; font-size: 12px;" class="">
<span style="font-family: Helvetica; font-size: 12px;" class="">so I tried and modify the @pop slot </span><br style="font-family: Helvetica; font-size: 12px;" class="">
<br style="font-family: Helvetica; font-size: 12px;" class="">
<i class=""><span style="font-family: Helvetica; font-size: 12px;" class="">region=read.table(“region.txt",head=T)</span><br style="font-family: Helvetica; font-size: 12px;" class="">
<span style="font-family: Helvetica; font-size: 12px;" class="">data841@pop<-region</span><br style="font-family: Helvetica; font-size: 12px;" class="">
</i><br style="font-family: Helvetica; font-size: 12px;" class="">
<span style="font-family: Helvetica; font-size: 12px;" class="">but I got:</span><br style="font-family: Helvetica; font-size: 12px;" class="">
<br style="font-family: Helvetica; font-size: 12px;" class="">
<i class=""><span style="font-family: Helvetica; font-size: 12px;" class="">Error in checkAtAssignment("genind", "pop", "data.frame") : </span><br style="font-family: Helvetica; font-size: 12px;" class="">
<span style="font-family: Helvetica; font-size: 12px;" class=""> assignment of an object of class "data.frame" is not valid for @'pop' in an object of class "genind"; is(value, "factorOrNULL") is not TRUE</span><br style="font-family: Helvetica; font-size: 12px;" class="">
</i><br style="font-family: Helvetica; font-size: 12px;" class="">
<span style="font-family: Helvetica; font-size: 12px;" class="">Is this just something I cannot do on a genind object?</span><br style="font-family: Helvetica; font-size: 12px;" class="">
<span style="font-family: Helvetica; font-size: 12px;" class="">any suggestion on how to easily change the apriori grouping of individuals (@pop) and perform DAPC</span><br style="font-family: Helvetica; font-size: 12px;" class="">
<br style="font-family: Helvetica; font-size: 12px;" class="">
<span style="font-family: Helvetica; font-size: 12px;" class="">many thanks in advance and all the best</span><br style="font-family: Helvetica; font-size: 12px;" class="">
<br style="font-family: Helvetica; font-size: 12px;" class="">
<span style="font-family: Helvetica; font-size: 12px;" class="">Massi</span><br style="font-family: Helvetica; font-size: 12px;" class="">
</div>
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>