<div>Hi All</div><div> </div><div>Further to this post, i tried giving all the individuals in the dataset a unique value before</div><div>importing as a geniod object in R, i then used the same code as below.</div><div> This still had the same effect at the end:</div>
<div> </div><div>&gt; m.dapc &lt;- dapc(m.pca, grp=pop(M))<br>Choose the number PCs to retain (&gt;=1): 23<br>Error in `row.names&lt;-.data.frame`(`*tmp*`, value = c(&quot;Axis1&quot;, &quot;Axis2&quot;,  : <br>  invalid &#39;row.names&#39; length<br>
</div><div>I tired on a friends Mac OS computer last night with the latest version of all packages</div><div>installed from CRAN and it still didnt work? This code worked in the past on older versions</div><div>of R and adegenet, im wondering if this is where the issue might lie?</div>
<div> </div><div>Has anyone tried running an (unedited)  Genpop file with the below commands in the new versions, im</div><div>interested to see if they can reproduce the errors i have.</div><div> </div><div>cheers</div><div>
Martin</div><div> </div><div><br>Martin van der Meer<br>PhD candidate<br>Molecular Ecology and Evolutionary Laboratory<br>Australian Tropical Sciences and Innovation Precinct</div><div>School of Marine and Tropical Biology<br>
James Cook University<br>Townsville<br>Australia</div><div><br> </div><div class="gmail_quote">On 19 September 2011 13:25, Martin van der Meer <span dir="ltr">&lt;<a href="mailto:martinhvandermeer@gmail.com">martinhvandermeer@gmail.com</a>&gt;</span> wrote:<br>
<blockquote style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;" class="gmail_quote"><div>Hi All</div><div> </div><div>Ive had to switch to a PC (Windows Vista) since the Mac OS system crashed. Ive installed R with all</div>
<div>the packages for running DAPC (ade4, Adegenet, MASS). I use the same command codes that i</div>
<div>used for R in the Mac OS. I have not changed the directories from where R was loaded and </div><div>all packages and R are the latest version. My file format is in Genepop. I have tried a vraiety of</div><div>methods including importing as a table and using read.table, giving individual numbers in the genepop file,</div>

<div> i have run R as an administrator, etc all to no avail. This is incredibely frustrating as it works without flaw </div><div>in the Mac OS. Any help would be appreciated. Here is the code im using for R:</div><div> </div>

<div> </div><div> </div><div>&gt; read.genepop(&quot;Aa.gen&quot;) -&gt; M</div><div> Converting data from a Genepop .gen file to a genind object... </div><div><br>File description:  Title line:&quot;Aa&quot; </div><div>
...done.</div>
<div>&gt; M1 &lt;- scaleGen(M, missing=&quot;mean&quot;)</div><div>Pop1 Pop2 Pop3 Pop4 Pop5 <br>  14   20   24   28   33 <br>Warning message:<br>In validityMethod(object) : <br>duplicate names in ind.names:</div><div>&gt; m.pca &lt;- dudi.pca(M1, center=FALSE, scale=FALSE, scannf=FALSE, nf=100)<br>

Error in `row.names&lt;-.data.frame`(`*tmp*`, value = c(&quot;Pop1&quot;, &quot;Pop1&quot;, &quot;Pop1&quot;,  : <br>  duplicate &#39;row.names&#39; are not allowed<br>In addition: Warning message:<br>non-unique values when setting &#39;row.names&#39;: ‘Pop1’, ‘Pop2’, ‘Pop3’, ‘Pop4’, ‘Pop5’ <br>

&gt; uniquewt.df(M1)-&gt; M2<br>Warning message:<br>In data.row.names(row.names, rowsi, i) :<br>  some row.names duplicated: 2,3,4,5,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119 --&gt; row.names NOT used<br>

&gt; m.pca &lt;- dudi.pca(M2, center=FALSE, scale=FALSE, scannf=FALSE, nf=100)<br>&gt; barplot(m.pca$eig, main=&quot;eigen&quot;)<br>&gt; temp &lt;- cumsum(m.pca$eig)/sum(m.pca$eig)<br>&gt; plot(temp, xlab=&quot;addedpc&quot;, ylab=&quot;totgenet&quot;)<br>

&gt; min(which(temp &gt; 0.95))<br>[1] 92<br>&gt; axis(1, at = 92, lab = 92)<br>&gt; segments(92, 0, 92, temp[92], col = &quot;red&quot;)<br>&gt; segments(-5, 0.95, 92, 0.95, col = &quot;red&quot;)<br>&gt; s.class(m.pca$li, M$pop, lab= M$pop.names, sub=&quot;PCA 1-2&quot;, csub= 2)<br>

&gt; add.scatter.eig(m.pca$eig[1:20], nf = 3, xax = 1, yax = 2, posi = &quot;bottom&quot;)<br>&gt; m.lda &lt;- lda(m.pca$li[, 1:92], grouping=pop(M))<br>&gt; names(m.lda)<br>[1] &quot;prior&quot;   &quot;counts&quot;  &quot;means&quot;   &quot;scaling&quot; &quot;lev&quot;     &quot;svd&quot;     &quot;N&quot;       &quot;call&quot;   <br>

&gt; m.pred &lt;- predict(m.lda)<br>&gt; m.pred$class<br>  [1] Pop1 Pop1 Pop1 Pop1 Pop1 Pop1 Pop1 Pop1 Pop1 Pop1 Pop1 Pop1 Pop1 Pop1 Pop2 Pop2 Pop2 Pop2 Pop2<br> [20] Pop2 Pop2 Pop2 Pop2 Pop2 Pop2 Pop2 Pop2 Pop2 Pop2 Pop2 Pop2 Pop2 Pop2 Pop2 Pop3 Pop3 Pop3 Pop3<br>

 [39] Pop3 Pop3 Pop3 Pop3 Pop3 Pop3 Pop3 Pop3 Pop3 Pop3 Pop3 Pop3 Pop3 Pop3 Pop3 Pop3 Pop3 Pop3 Pop3<br> [58] Pop3 Pop4 Pop4 Pop4 Pop4 Pop4 Pop4 Pop4 Pop4 Pop4 Pop4 Pop4 Pop4 Pop4 Pop4 Pop4 Pop4 Pop4 Pop4<br> [77] Pop4 Pop4 Pop4 Pop4 Pop4 Pop4 Pop4 Pop4 Pop4 Pop4 Pop5 Pop5 Pop5 Pop5 Pop5 Pop5 Pop5 Pop5 Pop5<br>

 [96] Pop5 Pop5 Pop5 Pop5 Pop5 Pop5 Pop5 Pop5 Pop5 Pop5 Pop5 Pop5 Pop5 Pop5 Pop5 Pop5 Pop5 Pop5 Pop5<br>[115] Pop5 Pop5 Pop5 Pop5 Pop5<br>Levels: Pop1 Pop2 Pop3 Pop4 Pop5<br>&gt; head(m.pred$posterior[, 1:5])<br>  Pop1         Pop2         Pop3         Pop4         Pop5<br>

1    1 4.177827e-31 1.917492e-27 1.506373e-34 7.272060e-35<br>2    1 4.848692e-28 9.903303e-25 2.649258e-33 4.010207e-35<br>3    1 4.937353e-20 5.195535e-16 1.195006e-19 2.183740e-24<br>4    1 4.608358e-19 1.503307e-15 7.937646e-22 5.661887e-24<br>

5    1 1.225733e-27 2.661842e-20 6.963585e-34 2.458251e-36<br>6    1 3.344632e-15 2.383149e-18 1.608183e-26 7.585079e-31<br>&gt; mean(m.pred$class==pop(M))<br>[1] 1<br>&gt; misAs &lt;-tapply(m.pred$class !=pop(M), pop(M), mean)<br>

&gt; barplot(misAs, xlab=&quot;populations&quot;, ylab= &quot;% of missassignments per pop&quot;, col=&quot;orange&quot;, las=3)<br>&gt; table.paint(head(m.pred$posterior, 119, col.lab= paste(&quot;population&quot;, 1:5, sep=&quot;.&quot;)))<br>

&gt; m.dapc &lt;- dapc(m.pca, grp=pop(M))<br>Choose the number PCs to retain (&gt;=1): 23<br>Error in `row.names&lt;-.data.frame`(`*tmp*`, value = c(&quot;Axis1&quot;, &quot;Axis2&quot;,  : <br>  invalid &#39;row.names&#39; length<br>

<br clear="all"><br>-- <br></div><font color="#888888"><div>Martin van der Meer<br>PhD candidate<br>Molecular Ecology and Evolutionary Laboratory<br>Australian Tropical Sciences and Innovation Precinct</div>
<div>School of Marine and Tropical Biology<br>James Cook University<br>Townsville<br>Australia</div><br>
</font></blockquote></div><br><br clear="all"><br>-- <br><div>Martin van der Meer<br>PhD candidate<br>Molecular Ecology and Evolutionary Laboratory<br>Australian Tropical Sciences and Innovation Precinct</div>
<div>School of Marine and Tropical Biology<br>James Cook University<br>Townsville<br>Australia</div><br>