<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>On my way to DAPC, I am stuck on an error finding clusters:<o:p></o:p></p><p class=MsoNormal>> grp <- find.clusters(a, max.n.clust=40)<o:p></o:p></p><p class=MsoNormal>Error in if (nf > rank) nf <- rank : missing value where TRUE/FALSE needed<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I imported an SSR matrix that has 1022 individuals, 6 loci, and 47 populations:<o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>>df <- read.loci(file.choose(), loci.sep=",", col.pop=2, col.loci=3:8)<o:p></o:p></span></p><p class=MsoNormal>And created a Genuind object using<o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>>loci<-df[,3:8]<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>>pop<-df[,2]<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>>sample<-df[,1]<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>>a <- df2genind (loci, ncode=3, sep = ",", missing = NA, ploidy = 1, >pop=pop, ind.names=sample)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>And confirmed that it is in the correct format using:<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>print(a, details = TRUE)<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal> #####################<o:p></o:p></p><p class=MsoNormal> ### Genind object ### <o:p></o:p></p><p class=MsoNormal> #####################<o:p></o:p></p><p class=MsoNormal>- genotypes of individuals - <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>S4 class: genind<o:p></o:p></p><p class=MsoNormal>@call: df2genind(X = loci, sep = ",", ncode = 3, ind.names = sample, <o:p></o:p></p><p class=MsoNormal> pop = pop, missing = NA, ploidy = 1)<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>@tab: 1022 x 6 matrix of genotypes<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>@ind.names: vector of 1022 individual names<o:p></o:p></p><p class=MsoNormal>@loc.names: vector of 6 locus names<o:p></o:p></p><p class=MsoNormal>@loc.nall: number of alleles per locus<o:p></o:p></p><p class=MsoNormal>@loc.fac: locus factor for the 6 columns of @tab<o:p></o:p></p><p class=MsoNormal>@all.names: list of 6 components yielding allele names for each locus<o:p></o:p></p><p class=MsoNormal>@ploidy: 1<o:p></o:p></p><p class=MsoNormal>@type: codom<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Optionnal contents: <o:p></o:p></p><p class=MsoNormal>@pop: factor giving the population of each individual<o:p></o:p></p><p class=MsoNormal>@pop.names: factor giving the population of each individual<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>@other: - empty -<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I am running 32 bit R version on a Windows 7 PC. I unintalled my R vers. 2.15.3 and installed R. vers. 3.0.2. <o:p></o:p></p><p class=MsoNormal>I have adegenet vers. 1.3-9.2. According to your web page, this is the most recent stable version, although adegenet-basics.pdf indicates that the adegenet version should be 1.4. <o:p></o:p></p><p class=MsoNormal>I have loaded the adegenet, pegas, MASS, and ade4 libraries. <o:p></o:p></p><p class=MsoNormal>I have searched the FAQ and every other source I can think of.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Help for an adegenet newbie will be most appreciated. NSF proposal deadline is looming ……<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Ann Willyard<o:p></o:p></p><p class=MsoNormal>Assistant Professor<o:p></o:p></p><p class=MsoNormal>Hendrix College<o:p></o:p></p><p class=MsoNormal>1600 Washington Ave<o:p></o:p></p><p class=MsoNormal>Conway AR 72032<o:p></o:p></p><p class=MsoNormal>501-450-1376<o:p></o:p></p><p class=MsoNormal>Willyard@hendrix.edu<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>