<div dir="ltr"><div><div>The error you get is one of the more common generic R errors out there... and when it comes from a parsing function like this, it's hard to diagnose, but I'm going to guess that there is something going on with the names of the samples in your data (because of step 206). Old genetic data formats are _terrible_ for storing data because they force you to contort it in unnatural ways (not your fault at all, just how things are).<br><br></div>The traceback you show is a bit strange... it shows a lot of noise from the dapcServer function, which shouldn't affect how read.genpop reads a file. Do you have dapcServer running?<br><br></div><div>Can you give more detail? Things that are unclear:<br><br></div><div>What is the Stacks2 'populations' script? <br></div><div>What version of adegenet do you have?<br></div><div>What version of R and RStudio are you running?</div><div>Did you have to manually manipulate your data file to get it into genepop format? <br><br><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 24, 2019 at 11:00 AM <<a href="mailto:adegenet-forum-request@lists.r-forge.r-project.org">adegenet-forum-request@lists.r-forge.r-project.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Send adegenet-forum mailing list submissions to<br>
<a href="mailto:adegenet-forum@lists.r-forge.r-project.org" target="_blank">adegenet-forum@lists.r-forge.r-project.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum" rel="noreferrer" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum</a><br>
<br>
or, via email, send a message with subject or body 'help' to<br>
<a href="mailto:adegenet-forum-request@lists.r-forge.r-project.org" target="_blank">adegenet-forum-request@lists.r-forge.r-project.org</a><br>
<br>
You can reach the person managing the list at<br>
<a href="mailto:adegenet-forum-owner@lists.r-forge.r-project.org" target="_blank">adegenet-forum-owner@lists.r-forge.r-project.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of adegenet-forum digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
1. length of 'dimnames' [1] not equal to array extent (Brian Simison)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Tue, 23 Apr 2019 12:03:35 -0700<br>
From: Brian Simison <<a href="mailto:bsimison@calacademy.org" target="_blank">bsimison@calacademy.org</a>><br>
To: <a href="mailto:adegenet-forum@lists.r-forge.r-project.org" target="_blank">adegenet-forum@lists.r-forge.r-project.org</a><br>
Subject: [adegenet-forum] length of 'dimnames' [1] not equal to array<br>
extent<br>
Message-ID:<br>
<CAM4LYpjCwSUHmn2SZUS_R5dzetc=<a href="mailto:OFnoG4mKoNm8zoz8uZjh8g@mail.gmail.com" target="_blank">OFnoG4mKoNm8zoz8uZjh8g@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
I have tried to convert various format output by Stacks2 'populations'<br>
script with no success. I have tried both structure and genepop formats and<br>
continually get the cryptic error "length of 'dimnames' [1] not equal to<br>
array extent"<br>
<br>
In Rstudio in Win10 I run:<br>
>Trach <- read.genepop("populations.gen")<br>
<br>
Converting data from a Genepop .gen file to a genind object...<br>
<br>
File description: 2_52, 2_53, 2_74, 4_15, 4_18, 4_39, 4_84, 5_17, 5_35,<br>
5_61, 6_24, 6_49, 6_50, 6_88, ... (I deleted the middle of the file<br>
description for space)<br>
... 45, 474683_54, 474839_33, 474839_38, 474839_56, 476311_31, 476311_59,<br>
476328_59, 477562_70, 477562_81, 479861_17<br>
Warning: Error in <-: length of 'dimnames' [1] not equal to array extent<br>
206: rownames<-<br>
205: read.genepop<br>
204: import2genind<br>
203: <reactive:getData> [C:\Program<br>
Files\R\R-3.5.1\library\adegenet\dapcServer/server.R#39]<br>
201: .func<br>
198: contextFunc<br>
197: env$runWith<br>
190: ctx$run<br>
189: self$.updateValue<br>
187: getData<br>
186: <reactive:getDapc> [C:\Program<br>
Files\R\R-3.5.1\library\adegenet\dapcServer/server.R#222]<br>
184: .func<br>
181: contextFunc<br>
180: env$runWith<br>
173: ctx$run<br>
172: self$.updateValue<br>
170: getDapc<br>
169: renderPlot [C:\Program<br>
Files\R\R-3.5.1\library\adegenet\dapcServer/server.R#248]<br>
167: func<br>
127: drawPlot<br>
113: <reactive:plotObj><br>
97: drawReactive<br>
84: origRenderFunc<br>
83: output$scatterplot<br>
3: runApp<br>
2: .dapcServer<br>
1: adegenetServer<br>
Warning: Error in <-: length of 'dimnames' [1] not equal to array extent<br>
101: <Anonymous><br>
Warning: Error in <-: length of 'dimnames' [1] not equal to array extent<br>
101: <Anonymous><br>
Warning: Error in <-: length of 'dimnames' [1] not equal to array extent<br>
101: <Anonymous><br>
Warning: Error in <-: length of 'dimnames' [1] not equal to array extent<br>
101: <Anonymous><br>
<br>
I have searched for this error and have failed to understand what<br>
"Dimnames" are.<br>
<br>
thank you in advance.<br>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
W. Brian Simison, Ph.D.<br>
Curator & Director of Comparative Genomics<br>
California Academy of Sciences<br>
55 Music Concourse Dr. SF, CA 94118<br>
O:415.379.5297<br>
M:415.310.1686<br>
<a href="mailto:bsimison@calacademy.org" target="_blank">bsimison@calacademy.org</a><br>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20190423/d3e324f3/attachment-0001.html" rel="noreferrer" target="_blank">http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20190423/d3e324f3/attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Subject: Digest Footer<br>
<br>
_______________________________________________<br>
adegenet-forum mailing list<br>
<a href="mailto:adegenet-forum@lists.r-forge.r-project.org" target="_blank">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" rel="noreferrer" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum</a><br>
<br>
------------------------------<br>
<br>
End of adegenet-forum Digest, Vol 127, Issue 2<br>
**********************************************<br>
</blockquote></div>