<div dir="ltr">Hi, <br><br>Sorry for the delay. I think the problem may be something simple to do with the format or row and column names of the object test. <br>When I tried the example with the data you sent, the first approach worked right away. <br><br>Can you try for me something perhaps silly just to rule this out as the solution: <br><br><div><div><span style="color:rgb(56,118,29)"># replace filename below with the path to your file, wherever it is on your computer</span></div><div><font color="#0000ff">filename <- "C:/Cait/Work/adegenet forum Qs/test.txt"</font></div><div><br></div><div><span style="color:rgb(56,118,29)"># use read.table to read in the file anew to try to get it in the same format that I have it in</span><font color="#38761d"><br></font></div><div><font color="#0000ff">test <- read.table(filename)</font></div><div><span style="color:rgb(56,118,29)"># confirm that it looks to have the correct dimensions, names, contents</span><font color="#0000ff"><br></font></div><div><font color="#0000ff">head(test)</font></div><div><font color="#0000ff"><br></font></div><div><span style="color:rgb(56,118,29)"># try creating a genind object out of test using the first approach you put forward</span><font color="#0000ff"><br></font></div><div><font color="#0000ff">obj1 <- genind(test, ploidy=1, type="PA")</font></div><div><span style="color:rgb(56,118,29)"># confirm that a genind was created</span><font color="#0000ff"><br></font></div><div><font color="#0000ff">obj1</font></div><div><span style="color:rgb(56,118,29)"># confirm that it looks the same as the original object when in matrix form</span><font color="#0000ff"><br></font></div><div><font color="#0000ff">head(as.matrix(obj1))</font></div></div><div><br></div><div>Then please let me know if that works for you. If not, could you paste back the results or errors you get from the above commands?</div><div><br></div><div>Best of luck. <br><br>Cheers, <br>Caitlin. </div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 25, 2014 at 11:04 AM, Jombart, Thibaut <span dir="ltr"><<a href="mailto:t.jombart@imperial.ac.uk" target="_blank">t.jombart@imperial.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif">
<div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt"><br>
<div><font>Hi there, <br>
<br>
it looks like a bug. I'll investigate and get back to you.<br>
<br>
Cheers<br>
Thibaut<br>
<br>
</font></div>
<div style="font-family:Times New Roman;color:#000000;font-size:16px">
<hr>
<div style="direction:ltr"><font color="#000000" face="Tahoma"><b>From:</b> <a href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org" target="_blank">adegenet-forum-bounces@lists.r-forge.r-project.org</a> [<a href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org" target="_blank">adegenet-forum-bounces@lists.r-forge.r-project.org</a>] on behalf of Jackie Lighten [Jackie.Lighten@Dal.Ca]<br>
<b>Sent:</b> 22 September 2014 12:59<br>
<b>To:</b> <a href="mailto:adegenet-forum@lists.r-forge.r-project.org" target="_blank">adegenet-forum@lists.r-forge.r-project.org</a><br>
<b>Subject:</b> [adegenet-forum] Trouble converting to genid object<br>
</font><br>
</div><div><div class="h5">
<div></div>
<div>
<div>Hi,</div>
<div><br>
</div>
<div>I am having trouble converting a presence/absence genotype data frame to a genid object</div>
<div><br>
</div>
<div>Please see attached for test data file.</div>
<div><br>
</div>
<div>Using </div>
<div><br>
</div>
<div>obj2 <- genind(test, ploidy=1, type="PA")</div>
<div><br>
</div>
<div>I get the error:</div>
<div><br>
</div>
<div>
<div>Error in `colnames<-`(`*tmp*`, value = c("L1", "L2")) : </div>
<div> length of 'dimnames' [2] not equal to array extent</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div>Using</div>
<div><br>
</div>
<div>obj2 <- df2genind(test, ploidy=1, type="PA")</div>
<div><br>
</div>
<div>I get the error:</div>
<div><br>
</div>
<div>
<div>Error in `colnames<-`(`*tmp*`, value = "L1") : </div>
<div> length of 'dimnames' [2] not equal to array extent</div>
<div>In addition: Warning messages:</div>
<div>1: In eval(expr, envir, enclos) : NAs introduced by coercion</div>
<div>2: In df2genind(test, ploidy = 1, type = "PA") :</div>
<div> entirely non-type marker(s) deleted</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div>Any help would be much appreciated</div>
<div><br>
</div>
<div>Thanks,</div>
<div><br>
</div>
<div>Jack</div>
</div>
</div></div></div>
</div>
</div>
<br>_______________________________________________<br>
adegenet-forum mailing list<br>
<a href="mailto:adegenet-forum@lists.r-forge.r-project.org">adegenet-forum@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum</a><br></blockquote></div><br></div>