<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;"><font size="2">Hello Mark,
<br>
<br>
yes, R will read stuff looking like integers as integers, so you want to specify the type as 'character' when reading the file in, and make sure characters are not converted to factors automatically (option stringsAsFactors).
<br>
<br>
I suspect "x" here may still contain non-allele data, so you may want to double check that.
<br>
<br>
Cheers<br>
Thibaut<br>
</font>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF534665"><font color="#000000" face="Tahoma" size="2"><b>From:</b> adegenet-forum-bounces@lists.r-forge.r-project.org [adegenet-forum-bounces@lists.r-forge.r-project.org] on behalf of Mark Coulson [coulsonmw@gmail.com]<br>
<b>Sent:</b> 28 November 2014 11:57<br>
<b>To:</b> adegenet-forum@lists.r-forge.r-project.org<br>
<b>Subject:</b> [adegenet-forum] data input<br>
</font><br>
</div>
<div></div>
<div>
<div dir="ltr">Hello,
<div><br>
</div>
<div>I am trying to read in a dataframe (rather than a genepop or other format) with 1 column as population, 1 column as individual and 1 column as River (which I would like as the @other tab). I've coded my alleles as 2-digit codes with no separator. In excel
 this looks like 1134 or 0230 for example. </div>
<div><br>
</div>
<div>I've done df2genind(x, sep=NULL, ind.names=x$Individual, pop=x$Population, missing="0", ploidy=2) but I get </div>
<div><br>
</div>
<div>
<div>Error in df2genind(scot, sep = NULL, ind.names = scot$Individual, pop = scot$Population,  : </div>
<div>  2 alleles cannot be coded by a total of 27 characters</div>
</div>
<div><br>
</div>
<div>I notice that R is reading any genotype beginning with a 0 as 230 instead of 0230. I may also want to include some additional 'other' variables such as coordinates so looking for options for bringing in a dataframe instead of particular genetic formats.</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Mark</div>
</div>
</div>
</div>
</div>
</body>
</html>