<div dir="ltr"><div><div><div><div><div><div><div><div><div><div><h1><span style="font-weight:normal">Hello</span><br></h1></div></div>I have been trying to convert my structure file to a genind object but I am having some issues.  I am getting this error and I can't find an appropriate fix.  I have looked through forum history and found a similar issue but the fix suggested didn't work for me.<br><br></div>my file looks like this:<br>Ind    Pop    tb109    tb117    tb129    tb130    tb136    tb187    tb188<br>GM4_283    1    118    108    132    125    122    168    159<br>GM4_283    1    120    112    138    129    122    176    168<br>GM336    1    114    112    128    123    124    168    0<br>GM336    1    116    112    136    123    128    176    0<br>GM337    1    0    110    126    123    126    168    159<br>GM337    1    0    112    126    123    126    176    174<br>E276    2    118    108    0    0    122    166    165<br>E276    2    118    112    0    0    122    176    190<br>E277    2    116    108    126    119    124    168    159<br>E277    2    118    112    138    129    128    176    174<br>E278    2    114    108    124    121    122    168    162<br>E278    2    114    112    126    125    128    176    180<br><br></div>I used the script<br><b>> tems<-read.structure("TBtest1.str",row.marknames=1,onerowperind=FALSE, n.ind=190, n.loc=7, col.lab=1, col.pop=2, ask=TRUE)</b><br><br></div>Which brings up the following message, and I press RETURN: <br><b> Which other optional columns should be read (press 'return' when done)? 1: <br><br> Converting data from a STRUCTURE .stru file to a genind object... </b><br><br>Then get this error:<br><br><b>Error in `colnames<-`(`*tmp*`, value = c("Ind", "Pop", "tb109", "tb117",  : <br>  length of 'dimnames' [2] not equal to array extent<br></b><br>Has anybody got a fix to get my original STRUCTURE file to work as a Genind object.?<br><br></div>As an aside, on the forum I found a work around under the title "Trouble converting to genid object", which converts a read.table document into genind which I followed and I got this error:<br>Warning message:<br>In .local(.Object, ...) : NAs introduced by coercion <br></div>and this file:<br>> head(as.matrix(obj1))<br>    V1 V2  V3  V4  V5  V6  V7  V8  V9<br>001 NA NA  NA  NA  NA  NA  NA  NA  NA<br>002 NA  1 118 108 132 125 122 168 159<br>003 NA  1 120 112 138 129 122 176 168<br>004 NA  1 114 112 128 123 124 168   0<br>005 NA  1 116 112 136 123 128 176   0<br>006 NA  1   0 110 126 123 126 168 159<br><br></div>So i would like a different solution to my problem if possible.<br></div>Many thanks<br></div>Charlotte<br><div><div><div><div><div><br><div><div><div><br><div><div><div><div class="gmail_signature"><div dir="ltr"><span>Charlotte<br><br></span></div></div>
</div></div></div></div></div></div></div></div></div></div></div></div>