0

I am trying to find the no. of clusters in my data using the find.clusters function od adegenet but i keep coming across an error.

> gl.test
 /// GENLIGHT OBJECT /////////

 // 491 genotypes,  11,394 binary SNPs, size: 6.6 Mb
 964418 (17.24 %) missing data

 // Basic content
   @gen: list of 491 SNPbin

 // Optional content
   @ind.names:  491 individual labels
   @loc.names:  11394 locus labels
   @chromosome: factor storing chromosomes of the SNPs
   @position: integer storing positions of the SNPs
   @other: a list containing: elements without names 
grp <- find.clusters(gl.test, max.n.clust=40)

Error:

Choose the number PCs to retain (>=1): Error in if (n.pca >= N) warning("number of retained PCs of PCA is greater than N") : 
  missing value where TRUE/FALSE needed
Calls: find.clusters ... find.clusters.matrix -> find.clusters -> find.clusters.data.frame
  • Not sure about `find.clusters()` function but [here is a link](https://stackoverflow.com/questions/15376075/cluster-analysis-in-r-determine-the-optimal-number-of-clusters) that shows how to implement the elbow method. – Sotos Jul 07 '20 at 14:31
  • Thanks for the suggestion. Will definitely try it out. – subhadra chakrabarty Jul 08 '20 at 17:25

0 Answers0