<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; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div><span style="font-family: Helvetica; font-size: 12px;">Dear Thibaud,</span><br style="font-family: Helvetica; font-size: 12px;">
<span style="font-family: Helvetica; font-size: 12px;">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;">
<span style="font-family: Helvetica; font-size: 12px;">The idea was to perform DAPCs and maximise differences between individuals from different regions/countries.</span><br style="font-family: Helvetica; font-size: 12px;">
<br style="font-family: Helvetica; font-size: 12px;">
<span style="font-family: Helvetica; font-size: 12px;">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;">
<br style="font-family: Helvetica; font-size: 12px;">
<span style="font-family: Helvetica; font-size: 12px;"><i>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;">
<br style="font-family: Helvetica; font-size: 12px;">
<span style="font-family: Helvetica; font-size: 12px;">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;">
<br style="font-family: Helvetica; font-size: 12px;">
<span style="font-family: Helvetica; font-size: 12px;">so I tried and modify the @pop slot </span><br style="font-family: Helvetica; font-size: 12px;">
<br style="font-family: Helvetica; font-size: 12px;">
<i><span style="font-family: Helvetica; font-size: 12px;">region=read.table(“region.txt",head=T)</span><br style="font-family: Helvetica; font-size: 12px;">
<span style="font-family: Helvetica; font-size: 12px;">data841@pop<-region</span><br style="font-family: Helvetica; font-size: 12px;">
</i><br style="font-family: Helvetica; font-size: 12px;">
<span style="font-family: Helvetica; font-size: 12px;">but I got:</span><br style="font-family: Helvetica; font-size: 12px;">
<br style="font-family: Helvetica; font-size: 12px;">
<i><span style="font-family: Helvetica; font-size: 12px;">Error in checkAtAssignment("genind", "pop", "data.frame") : </span><br style="font-family: Helvetica; font-size: 12px;">
<span style="font-family: Helvetica; font-size: 12px;"> 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;">
</i><br style="font-family: Helvetica; font-size: 12px;">
<span style="font-family: Helvetica; font-size: 12px;">Is this just something I cannot do on a genind object?</span><br style="font-family: Helvetica; font-size: 12px;">
<span style="font-family: Helvetica; font-size: 12px;">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;">
<br style="font-family: Helvetica; font-size: 12px;">
<span style="font-family: Helvetica; font-size: 12px;">many thanks in advance and all the best</span><br style="font-family: Helvetica; font-size: 12px;">
<br style="font-family: Helvetica; font-size: 12px;">
<span style="font-family: Helvetica; font-size: 12px;">Massi</span><br style="font-family: Helvetica; font-size: 12px;">
</div>
</body>
</html>