thibautjombart / adegenet

adegenet: a R package for the multivariate analysis of genetic markers
169 stars 64 forks source link

find.clusters not working #289

Open subha-sorghum opened 4 years ago

subha-sorghum commented 4 years ago

i am trying to find the no. of clusters in my dataset but i keep getting error.

Code:

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
romunov commented 4 years ago

N in this case is the number of rows in your dataset. My guess is that if you do nrow(gl.test) you'll come up with a number less or equal to 40.

subha-sorghum commented 4 years ago

I actually have 191 rows in gl.test

zkamvar commented 3 years ago

What did you enter when you saw this prompt?

Choose the number PCs to retain (>=1): 

The error is saying that n.pca >= N is a missing value, which makes me think that this interactive step was skipped (which means that I need to fix the internal workings of it to validate the input).