<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
Hi Thibaut
<div><br>
</div>
<div>There seems to be a problem with the function <font face="Courier">find.clusters</font> if applied hierarchically using the argument
<font face="Courier">clust</font>:</div>
<div><br>
</div>
<div>
<div><font face="Courier">> test</font></div>
<div><font face="Courier"><br>
</font></div>
<div><font face="Courier"> #####################</font></div>
<div><font face="Courier"> ### Genind object ### </font></div>
<div><font face="Courier"> #####################</font></div>
<div><font face="Courier">- genotypes of individuals - </font></div>
<div><font face="Courier"><br>
</font></div>
<div><font face="Courier">S4 class: genind</font></div>
<div><font face="Courier">@call: .local(x = x, i = i, j = j, drop = drop)</font></div>
<div><font face="Courier"><br>
</font></div>
<div><font face="Courier">@tab: 396 x 209 matrix of genotypes</font></div>
<div><font face="Courier"><br>
</font></div>
<div><font face="Courier">@ind.names: vector of 396 individual names</font></div>
<div><font face="Courier">@loc.names: vector of 20 locus names</font></div>
<div><font face="Courier">@loc.nall: number of alleles per locus</font></div>
<div><font face="Courier">@loc.fac: locus factor for the 209 columns of @tab</font></div>
<div><font face="Courier">@all.names: list of 20 components yielding allele names for each locus</font></div>
<div><font face="Courier">@ploidy: 2</font></div>
<div><font face="Courier">@type: codom</font></div>
<div><font face="Courier"><br>
</font></div>
<div><font face="Courier">Optional contents: </font></div>
<div><font face="Courier">@pop: </font><span style="font-family: Courier; ">- empty -</span></div>
<div><font face="Courier">@pop.names: </font><span style="font-family: Courier; ">- empty -</span></div>
<div><font face="Courier"><br>
</font></div>
<div><font face="Courier">@other: - empty -</font></div>
</div>
<div><font face="Courier"><br>
</font></div>
<div><font face="Courier"><br>
</font></div>
<div>
<div style="font-family: Courier; ">> str(clustfac)</div>
<div style="font-family: Courier; "> Factor w/ 4 levels "A","B","C","D": 1 1 1 1 1 1 1 1 1 1 …</div>
<div style="font-family: Courier; "><br>
</div>
<div style="font-family: Courier; "><br>
</div>
<div style="font-family: Courier; "><br>
</div>
<div style="font-family: Courier; "><span style="font-family: Helvetica; ">This is where the error appears:</span></div>
<div style="font-family: Courier; "><br>
</div>
<div style="font-family: Courier; ">
<div>> hclust <- find.clusters(test, clust=clustfac)</div>
<div><br>
</div>
<div>Looking for sub-clusters in cluster A </div>
<div>Choose the number PCs to retain (>=1): </div>
<div>32</div>
<div>Error: number of cluster centres must lie between 1 and nrow(x)</div>
<div><br>
</div>
<div><br>
</div>
<div>> table(clustfac)</div>
<div>clustfac</div>
<div> A B C D</div>
<div> 33 30 138 195 </div>
</div>
<div style="font-family: Courier; "><br>
</div>
<div style="font-family: Courier; "><br>
</div>
<div>If not applied hierarchically, find.clusters will take the maximal available n.pca, even if the n.pca argument passed over is greater than nrow(x), right? Here, 33 individuals have factor level "A", therefore 32 is NOT outside
<font face="Courier">1 and nrow(x)</font>. The same error appears when using any number of PCs, say 2, 5, 30 or 400.</div>
<div><br>
</div>
<div>What went wrong? Any help is greatly appreciated.</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div>Best,</div>
<div>Simon</div>
<div><br>
</div>
<div><br>
</div>
<div>PhD Candidate</div>
<div>Institute of Integrative Biology</div>
<div>ETH Zurich</div>
<div>Switzerland</div>
</body>
</html>